我在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引擎 将experimental改为true 按应用并重新启动

.

其他回答

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

我在Windows 10上也遇到了同样的问题。我通过在实验模式下运行Docker守护进程来绕过它:

右键单击Windows系统托盘中的Docker图标 进入设置 守护进程 先进的 设置“experimental”:true 重启码头工人

更新为Windows 10 20H2

转到Docker配置 进入Docker Engine选项卡 将行“experimental”:false更改为“experimental”:true 使用应用&重启按钮重新启动Docker


你也可以手动修改配置文件,用你最喜欢的代码编辑器打开它(可视代码,notepad++…),例如:

# BACKUP Your file with PowerShell
Copy-Item -Path C:\ProgramData\Docker\config\daemon.json -Destination C:\ProgramData\Docker\config\daemon.json.backup

# Open the file with Visual Code
code C:\ProgramData\Docker\config\daemon.json

或者直接用Powershell更改字符串

# Set Path in variable
$FILE = "C:\ProgramData\Docker\config\daemon.json"

# Replace '"experimental": false' to '"experimental": true'
(Get-Content -Path $FILE) -replace '"experimental": false','"experimental": true' | Set-Content -Path $FILE

# Check the file content
type $FILE

输出示例

PS C:\WINDOWS\system32> type $FILE
{
  "registry-mirrors": [],
  "insecure-registries": [],
  "debug": false,
  "experimental": true
}

在您需要重新启动Docker守护进程后

PS C:\WINDOWS\system32> Restart-Service docker

检查服务状态

PS C:\WINDOWS\system32> Get-Service docker
Status   Name               DisplayName
------   ----               -----------
Running  docker             Docker Engine

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

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

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

请使用Powershell终端。