我在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

我该如何解决这个问题?


当前回答

确保您没有尝试使用Linux/WSL来提取Windows映像。

请使用Powershell终端。

其他回答

另一种可能的方法是:

在系统托盘中,右键单击docker图标,然后单击切换到Linux容器。

(Docker for Windows, Community Edition, version 18.03.1)

我在Azure DevOps管道中得到了这个错误。

Step 1/7 : FROM nginx:alpine
alpine: Pulling from library/nginx
no matching manifest for windows/amd64 10.0.14393 in the manifest list entries
##[error]C:\Program Files\Docker\docker.exe failed with return code: 1
##[section]Finishing: Build an image

问题是我选择了托管的VS2017而不是托管的Ubuntu。在进行如下更改后,构建成功。

希望能有所帮助。

弃用' latest '标签

为了鼓励更好的容器实践,我们在所有Windows基映像中都弃用' latest '标签。在2019日历年年初,我们将不再发布标签;我们将从可用标记列表中删除它。

我们强烈建议您声明希望在生产环境中运行的特定容器标记。“latest”标签是specific的反义词;除了图像名称,它不会告诉用户容器实际是什么版本。你可以阅读更多关于版本兼容性和选择适当的标签在我们的容器文档。

https://techcommunity.microsoft.com/t5/containers/windows-server-2019-now-available/ba-p/382430#

版本:Windows 10

步骤1:右键单击Docker实例并进入设置

步骤2:基本到高级,并设置“实验”:true

步骤3:重启Docker

步骤4:安装dockerfile成功(例如:docker build -t williehao/cheers2019)

确保您没有尝试使用Linux/WSL来提取Windows映像。

请使用Powershell终端。