我在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容器模式。因此,如果您不确定想要提取的映像是为Windows体系结构构建的,那么您需要切换到Linux容器。

其他回答

Docker run McR.microsoft.com/windows/servercore:ltsc2016

试试上面的命令。 您正在提取的内容应该与您所在的底层Windows版本兼容。如果你使用的是Windows server 2016,上面的内容也适用。

关注这条线索获取更多信息

https://github.com/docker/for-win/issues/3761

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

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

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

在码头工人:

进入设置 转到Docker引擎 将experimental改为true 按应用并重新启动

.

显示此消息的原因是无法找到正在运行的Linux容器。因此,在运行它之前,请确保从windows容器切换到linux容器。

我在开始学习docker时遇到过这个错误,我对这个场景的理解如下:

为什么你提到这个问题: 因为你引用的是基于Linux的镜像,而你目前使用的是基于windows的平台来运行/构建docker镜像。

解决方法: 简单的回答:要么将当前平台切换到Linux模式,要么拉出基于windows的映像。 以下是可能的选项:

切换到Linux容器,因为错误是“没有匹配清单for windows/amd64” 设置docker环境为“experimental”:true。 提取特定于平台的图像 例如:docker pull——platform {linux/Windows} {image-name}