我在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容器上!

现在所有的Node.Js docker映像都是不可拉的。总是检查你要拉之前的图像。

相关Github-Issue

其他回答

我在Windows 10中通过运行管理Powershell解决了这个问题:

cd "C:\Program Files\Docker\Docker"

然后:

./DockerCli.exe -SwitchDaemon

看起来在windows 10 #1100中“docker pull”失败了

如果添加——experimental不起作用,考虑重新安装docker for windows。

您已进入Windows容器模式。因此,如果您不确定想要提取的映像是为Windows体系结构构建的,那么您需要切换到Linux容器。

你需要先使用Linux平台,然后才能在Windows上运行:

docker pull --platform linux php
docker run -it php

参见博文Docker for Windows Desktop 18.02 with Windows 10 Fall Creators Update。

在Windows上,必须编辑文件守护进程。Json或windows-daemon-options。在Windows上,配置文件的默认位置是%programdata%\docker\config\daemon。Json或%programdata%\docker\resources\windows-daemon-options.json

json文件上的可选字段特性,允许用户启用或禁用特定的守护进程特性。示例:{" features":{"buildkit": true}}启用buildkit作为默认的docker映像构建器。