无法运行或拉取 Windows Docker 镜像。

5
这里,我无法拉取或运行任何Windows Docker镜像(来自Windows或Linux)。
尝试在Windows命令提示符中时:
拉取:
docker pull mcr.microsoft.com/windows
Using default tag: latest
Error response from daemon: manifest for mcr.microsoft.com/windows:latest not found: manifest unknown: manifest tagged by "latest" is not found

运行:

docker run mcr.microsoft.com/windows:1903
Unable to find image 'mcr.microsoft.com/windows:1903' locally
1903: Pulling from windows
docker: no matching manifest for linux/amd64 in the manifest list entries.
See 'docker run --help'.

有什么技巧吗?

1个回答

6

docker: no matching manifest for linux/amd64 in the manifest list entries. 这表示该镜像仅适用于 Windows 平台。

尽管你在使用 Windows,但默认情况下 docker desktop 可能会使用 linux 容器。在拉取此镜像之前,你应该通过点击桌面托盘上的 Docker 图标,右键选择切换到 windows 容器

enter image description here

切换后,你就可以成功拉取该镜像了:

C:\Windows\System32>docker pull mcr.microsoft.com/windows:1903
1903: Pulling from windows
af1a530dff54: Downloading [==========>                                      ]    738MB/3.657GB                        
123ee413bb26: Downloading [===================>                               ]  994.8MB/2.51GB 

顺便提一下,这个镜像没有设置 latest 标签,所以你需要使用详细的版本号,例如 19.03。


+1 太棒了!这个可行!只是想知道,有没有编程的方法来做到这一点?例如 docker system --switch-to-windows - John Henckel
1
尝试使用 "C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchDaemon,其他参数包括 -SwitchLinuxEngine-SwitchWindowsEngine - atline

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接