我在Windows上使用Docker,当我试图用这个命令拉一个PHP图像时
$ docker pull php
我收到了这样的信息:
Using default tag: latest
latest: Pulling from library/php no matching manifest for windows/amd64
in the manifest list entries
我该如何解决这个问题?
我在Windows上使用Docker,当我试图用这个命令拉一个PHP图像时
$ docker pull php
我收到了这样的信息:
Using default tag: latest
latest: Pulling from library/php no matching manifest for windows/amd64
in the manifest list entries
我该如何解决这个问题?
当前回答
我在Windows 10中通过运行管理Powershell解决了这个问题:
cd "C:\Program Files\Docker\Docker"
然后:
./DockerCli.exe -SwitchDaemon
其他回答
看起来在windows 10 #1100中“docker pull”失败了
如果添加——experimental不起作用,考虑重新安装docker for windows。
您已进入Windows容器模式。因此,如果您不确定想要提取的映像是为Windows体系结构构建的,那么您需要切换到Linux容器。
我在开始学习docker时遇到过这个错误,我对这个场景的理解如下:
为什么你提到这个问题: 因为你引用的是基于Linux的镜像,而你目前使用的是基于windows的平台来运行/构建docker镜像。
解决方法: 简单的回答:要么将当前平台切换到Linux模式,要么拉出基于windows的映像。 以下是可能的选项:
切换到Linux容器,因为错误是“没有匹配清单for windows/amd64” 设置docker环境为“experimental”:true。 提取特定于平台的图像 例如:docker pull——platform {linux/Windows} {image-name}
在我升级Docker Desktop(之前配置了WSL2集成)后,我就遇到了这种情况。
如果你在升级后遇到这种情况,仅供参考,我必须做以下工作:
以管理员(提升)模式运行PowerShell,执行如下命令:
cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchDaemon
如果你不这样做,你可能无法打开Docker Desktop上的Settings选项卡。
然后,您需要在设置中切换到Linux容器(通过取消勾选“使用基于WSL2的引擎”),然后重新启动。
在这一点上,只需运行一个快速测试,下载一个图像并运行一个容器,看看是否解决了问题:
docker run --rm -ti alpine:latest uname -a
Linux 2b08b155a042 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 Linux
从那里,如果您正在运行WSL2集成,只需返回到Settings屏幕并撤消我们在第2步中所做的选择(这将重新启动docker)。
此时,您将看到升级之前的所有映像和停止的容器。
我有同样的问题运行Windows IIS映像使用docker for Windows。读了上面Mohammad Trabelsi的回复,我意识到要解决我的问题,我需要把我的容器(在docker上)切换到Windows容器。
这样做:
右击Docker实例 选择“切换到Windows容器…”