我在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
我该如何解决这个问题?
当前回答
我在开始学习docker时遇到过这个错误,我对这个场景的理解如下:
为什么你提到这个问题: 因为你引用的是基于Linux的镜像,而你目前使用的是基于windows的平台来运行/构建docker镜像。
解决方法: 简单的回答:要么将当前平台切换到Linux模式,要么拉出基于windows的映像。 以下是可能的选项:
切换到Linux容器,因为错误是“没有匹配清单for windows/amd64” 设置docker环境为“experimental”:true。 提取特定于平台的图像 例如:docker pull——platform {linux/Windows} {image-name}
其他回答
弃用' latest '标签
为了鼓励更好的容器实践,我们在所有Windows基映像中都弃用' latest '标签。在2019日历年年初,我们将不再发布标签;我们将从可用标记列表中删除它。
我们强烈建议您声明希望在生产环境中运行的特定容器标记。“latest”标签是specific的反义词;除了图像名称,它不会告诉用户容器实际是什么版本。你可以阅读更多关于版本兼容性和选择适当的标签在我们的容器文档。
https://techcommunity.microsoft.com/t5/containers/windows-server-2019-now-available/ba-p/382430#
显示此消息的原因是无法找到正在运行的Linux容器。因此,在运行它之前,请确保从windows容器切换到linux容器。
另一种可能的方法是:
在系统托盘中,右键单击docker图标,然后单击切换到Linux容器。
(Docker for Windows, Community Edition, version 18.03.1)
我有同样的问题运行Windows IIS映像使用docker for Windows。读了上面Mohammad Trabelsi的回复,我意识到要解决我的问题,我需要把我的容器(在docker上)切换到Windows容器。
这样做:
右击Docker实例 选择“切换到Windows容器…”
右击Docker实例 进入设置 守护进程 先进的 设置“experimental”:true 重启码头工人
{
"registry-mirrors": [],
"insecure-registries": [],
"debug": true,
"experimental": true
}