Azure DevOps 托管代理无法拉取 Windows :2004

标签 azure docker azure-devops azure-devops-self-hosted-agent

使用Windows-2019hosted agent (使用 1809 Windows 版本安装的代理 - Microsoft Windows Server 2019 Datacenter )作为代理规范,我们无法提取 mcr.microsoft.com/windows:2004 docker 镜像。

异常(exception):

enter image description here

我熟悉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-latestwindows-2019 (1809)。我们只能拉取镜像windows:1809与托管代理。

docker pull mcr.microsoft.com/windows/servercore:1809

enter image description here

但是,如果我拉取图像 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可以解决这个错误。

引用链接:

List of Microsoft Windows versions

Unable to pull images from microsoft

关于Azure DevOps 托管代理无法拉取 Windows :2004,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64303955/

相关文章:

azure - 嵌入本地数据的 Power BI

docker - 许可证主题的 Kafka Connect 复制因子

azure - 如何通过 Postman 将 ChatGPT 请求发送到 Azure OpenAI?

angular - 如何在 Angular 中访问 Azure 静态 Web 应用程序应用程序设置?

docker - 如何在Kubernetes上部署Mule Application?

javascript - 无法使用 Azure DevOps Rest API 上传图像(二进制)

c# - 通过带有前缀的 yaml 从 keyvault 动态获取多个 secret

Azure DevOps 日历 - 不允许使用 "Add days off"

azure - 为什么需要向输出绑定(bind)添加 out 参数?

windows - 删除所有停止的容器(在 Windows 上)?