[英]Azure DevOps hosted-agent failed to pull windows:2004
When using Windows-2019
hosted agent (Agent installed with 1809 windows version - Microsoft Windows Server 2019 Datacenter ) as Agent Specification, We can't pull mcr.microsoft.com/windows:2004
docker image.当使用Windows-2019
托管代理(安装了 1809 windows 版本的代理 - Microsoft Windows Server 2019 Datacenter )作为代理规范时,我们无法拉取mcr.microsoft.com/windows:2004
镜像。
Exception:例外:
I'm familiar with this solution (Which works perfectly locally).我熟悉这个解决方案(它在本地工作得很好)。 But, since Docker Desktop doesn't install on the agent I can't switch to Windows containers.但是,由于 Docker Desktop 没有安装在代理上,我无法切换到 Windows 容器。 Moreover, Install Docker Desktop is not an option since reboot required.此外,安装 Docker Desktop 不是一个选项,因为需要重新启动。
Currently, Creating a build machine is not an option.目前,创建构建机器不是一个选项。
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
映像吗?
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 映像吗?
I am afraid there is no such way to pull mcr.microsoft.com/windows:2004
docker image from the hosted agent.恐怕没有这样的方法可以从托管代理中提取mcr.microsoft.com/windows:2004
映像。
That because 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. Windows Server 容器和底层主机共享一个内核,容器的基本映像必须与主机的基本映像相匹配。 If the versions are different, the container may start, but full functionally isn't guaranteed.如果版本不同,容器可能会启动,但不能保证功能齐全。
In other words, Windows requires the host OS version to match the container OS version.换句话说,Windows 要求主机操作系统版本与容器操作系统版本相匹配。 If you want to run a container based on a newer Windows build, make sure you have an equivalent host build.如果要运行基于较新 Windows 版本的容器,请确保您具有等效的主机版本。 Otherwise, you can use Hyper-V isolation to run older containers on new host builds.否则,您可以使用 Hyper-V 隔离在新主机版本上运行旧容器。
So , we could not pull the image windows:2004
( 2004
) from the hosted agent windows-latest
OR windows-2019
( 1809
).因此,我们无法从托管代理windows-latest
OR windows-2019
( 1809
) 中提取图像windows:2004
( 2004
)。 We could only pull the image windows:1809
with the hosted agent.我们只能使用托管代理拉取图像windows:1809
。
docker pull mcr.microsoft.com/windows/servercore:1809
However , if I pull the image windows:1903
with hosted agent, I will get the error no matching manifest for windows/amd64...
.但是,如果我使用托管代理拉取图像windows:1903
,我将收到错误no matching manifest for windows/amd64...
。 In order to verify my answer, I use the private agent, which hosted on the windows version 1903
(OS build 18362
), It works fine.为了验证我的答案,我使用了托管在 Windows 版本1903
(操作系统版本18362
)上的私有代理,它工作正常。
In summary, we cannot pull windows:2004 (2004) image on the hosted agent (1809).总之,我们无法在托管代理 (1809) 上拉取 windows:2004 (2004) 映像。 The workaround for this request is that use the private agent.此请求的解决方法是使用私有代理。
BTW, I have tested those solutions which mentioned in the link in your question with private agent.顺便说一句,我已经与私人代理一起测试了您在问题中的链接中提到的那些解决方案。 Neither switch to Linux containers
nor set the "experimental": true
can solve this error.无论是switch to Linux containers
还是set the "experimental": true
都可以解决这个错误。
The Reference links:参考链接:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.