Visual Studio团队服务失败任务Docker生成(Visual Studio Team Service fails Task Docker Build)

编程入门 行业动态 更新时间:2024-10-15 16:19:02
Visual Studio团队服务失败任务Docker生成(Visual Studio Team Service fails Task Docker Build)

我试图运行构建Docker任务来创建泊坞窗图像。 我建立了一个docker主机,我使用defautl Docker Hub作为注册表,我的整个环境都在Azure上。

当我排队构建任务时,它在任务Docker上失败。

日志输出:

检查路径:null任务结果:失败

未找到docker:null

完成任务:Docker

[错误]任务Docker失败。 这导致作业失败。 查看任务的日志以获取更多详细信息。

有人对可能发生的事情有任何想法吗?

I'm trying to run build Docker task to create a docker image. I set up a docker host, I'm using defautl Docker Hub as registry and my whole environment is on Azure.

When I queue a build task it fails at Task Docker.

Log output:

check path : null task result: Failed

Not found docker: null

Finishing task: Docker

[error]Task Docker failed. This caused the job to fail. Look at the logs for the task for more details.

Does someone have any thought on what may be happening?

最满意答案

仔细研究之后,如果Docker未正确安装在代理正在运行的服务主体的构建代理上,看起来会发生这种情况。

请记住:

Build 必须在私有代理中运行,因为托管的还没有安装Docker,因为文档底部的脚注非常小。 VSTS代理程序必须运行一个主体,该主体具有为docker设置的环境变量才能运行; 默认情况下是LocalService帐户,它不会安装。 事实证明这也是其他问题的一个问题,我发现最好有一个特殊的用户主体来运行代理,也可以登录系统。

解决这两个问题使它适用于我。

After looking into this, it would seem this happens if Docker is not properly installed on the build agent for the service principal the agent is running under.

Keep in mind that:

The Build must be run in a private agent, as the hosted ones do not yet have Docker installed, as per a very small footnote in the bottom of the documentation. The VSTS agent must be running with a principal that has the environment variables set for docker to run; the default is LocalService account, which won't have that installed. This turns out to be a problem with other stuff as well and I've found it best to have a special user principal to run the agent under, that can also log into the system.

Fixing these two issues made it work for me.

更多推荐

本文发布于:2023-08-01 07:27:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1354919.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:团队   Docker   Visual   Studio   Team

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!