英文:
The requested image's platform does not match the detected host platform and no specific platform was requested
问题
以下是要翻译的内容:
"当我试图构建一个容器时,我遇到了这个问题,不得不尝试很多方法来找到问题所在。如果我在Windows上尝试构建一个基于Linux的容器,就会发生这种情况。
[警告] 请求的镜像平台(linux/amd64)与检测到的主机平台(windows/amd64)不匹配,且没有请求特定平台。"
英文:
as I was trying to Build a container, I faced this issue and had to try a lot of stuff to find the problem. This happens if I try to build a Linux-based container on windows.
[Warning] The requested image's platform (linux/amd64) does not match the detected host platform (windows/amd64) and no specific platform was requested
答案1
得分: 1
只需将 Windows 容器切换回 Linux 容器,它应该可以正常工作(对我有效)。现在,如果你遇到了相同的问题,但是在启动容器时,可以尝试添加选项 --platform=linux/amd64
或适合你的选项。
英文:
After trying everything on the Internet I remembered that I had switched to windows containers to troubleshoot something.
Just switch Windows Containers back to Linux Containers and it should work (It worked for me)
Now if you have the same issue but on starting a container, then go ahead and add the option --platform=linux/amd64
or whatever suits you.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论