使用Windows-2019
时hosted agent (使用 1809 Windows 版本安装的代理 - Microsoft Windows Server 2019 Datacenter )作为代理规范,我们无法提取 mcr.microsoft.com/windows:2004
docker 镜像。
异常(exception):
我熟悉this solution (在本地完美运行)。 但是,由于 Docker Desktop 未安装在代理上,我无法切换到 Windows 容器。此外,安装 Docker Desktop 不是一个选项,因为需要重新启动。
目前,创建构建机器不是一个选项。
所以我的问题是:有办法从托管代理中提取 mcr.microsoft.com/windows:2004
docker 镜像吗?
最佳答案
So my question is: There is a way to pull mcr.microsoft.com/windows:2004 docker image from the hosted agent?
恐怕没有这样的办法拉mcr.microsoft.com/windows:2004
来自托管代理的 docker 镜像。
那是因为 Matching container host version with container image versions :
Windows Server containers and the underlying host share a single kernel, the container’s base image must match that of the host. If the versions are different, the container may start, but full functionally isn't guaranteed.
换句话说,Windows 要求主机操作系统版本与容器操作系统版本相匹配。如果您想运行基于较新 Windows 版本的容器,请确保您具有等效的主机版本。否则,您可以使用 Hyper-V 隔离在新主机版本上运行旧容器。
所以,我们无法提取图像 windows:2004
( 2004
) 来自托管代理 windows-latest
或windows-2019
(1809
)。我们只能拉取镜像windows:1809
与托管代理。
docker pull mcr.microsoft.com/windows/servercore:1809
但是,如果我拉取图像 windows:1903
使用托管代理,我会收到错误 no matching manifest for windows/amd64...
。为了验证我的答案,我使用了托管在Windows版本1903
上的私有(private)代理。 (操作系统版本 18362
),工作正常。
总之,我们无法在托管代理 (1809) 上提取 windows:2004 (2004) 镜像。此请求的解决方法是使用私有(private)代理。
顺便说一句,我已经测试了 the link 中提到的那些解决方案在你向私有(private)代理人提出的问题中。两者都不是switch to Linux containers
也不set the "experimental": true
可以解决这个错误。
引用链接:
关于Azure DevOps 托管代理无法拉取 Windows :2004,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64303955/