Windows Server 2016安装Docker拉取镜像提示no matching manifest错误求助
报错原因说明
- 执行
docker pull php提示找不到匹配清单:你当前使用的Windows Server 2016(内部版本14393)默认拉取镜像时会优先匹配同系统版本的Windows容器镜像,而PHP、Node、Debian这类主流公开镜像绝大多数都是Linux系统镜像,官方也早已停止为Windows Server 2016提供对应版本的Windows适配镜像,因此会拉取失败。 - 执行
docker pull php-amd64提示权限不足:Docker Hub上不存在php-amd64这个公共镜像,镜像名称无效因此拉取被拒绝。 - 切换容器类型命令失效:你执行的
& $Env:ProgramFiles\Docker\Docker\DockerCli.exe -SwitchDaemon是Docker桌面版的切换命令,你安装的是Windows服务器版的Mirantis容器运行时,没有对应程序文件,因此切换无效。
解决方案
方案一:配置Linux容器运行环境(LCOW)
你已经在daemon.json中开启了实验模式,只需额外配置LCOW即可运行Linux容器:
- 先拉取LCOW内核镜像:
docker pull mcr.microsoft.com/oss/linuxkit/lcow:latest
- 修改
C:\ProgramData\docker\config\daemon.json,添加lcow.enabled配置:
{ "registry-mirrors": [], "insecure-registries": [], "debug": false, "experimental": true, "lcow.enabled": true }
- 重启Docker服务生效:
Restart-Service docker
- 后续拉取Linux镜像时指定platform参数即可:
docker pull --platform linux php docker pull --platform linux node docker pull --platform linux debian
方案二:使用Windows容器
如果需要运行Windows容器,只能选择适配Windows Server 2016(1607版本/内部版本14393)的镜像,拉取时需要指定对应标签:
# 示例:拉取对应版本的Nano Server基础镜像 docker pull mcr.microsoft.com/windows/nanoserver:1607
主流应用的Windows 2016适配镜像已经很少维护,你可以基于上述基础镜像自行构建所需的应用镜像。
替代方案
Windows Server 2016的容器支持已经停止维护,兼容性问题较多,建议升级到Windows Server 2019/2022获得更好的容器支持,或者直接部署Linux虚拟机运行Docker,稳定性更高。
内容的提问来源于stack exchange,提问作者Lucas Mercier
相关产品推荐
相关产品推荐

