请求的图像平台与检测到的主机平台不匹配,且未请求特定平台。

huangapple go评论55阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年2月7日 00:34:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/75364085.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定