docker - Azure DevOps在同一代理(VM)上的多个Docker容器

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

我必须在VM上使用Azure DevOps代理,因为该VM位于特殊网络中(因此不能使用AKS等)

VM已安装Docker并且管道已指定容器进行作业

如何在同一个VM(代理)上执行多个Docker容器以并行运行作业

最佳答案

我发现的最简单的方法是在系统启动时执行以下bash脚本(通过@reboot /root/ados-agents-start.sh添加crontab -e):


for run in {1..3}
do
  docker run -d -e VSTS_ACCOUNT='kagarlickij' -e VSTS_POOL='Self-Hosted' -e VSTS_TOKEN='a***q' mcr.microsoft.com/azure-pipelines/vsts-agent:ubuntu-16.04-docker-18.06.1-ce > /dev/null 2>&1
done

关于docker - Azure DevOps在同一代理(VM)上的多个Docker容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59814382/

相关文章:

docker - 无法减少docker容器内的ulimit

import - 如何将 wiki 移动到 Azure DevOps 中的其他项目

Azure Builds NuGetToolInstaller 缓存版本已过时,如何更新?

c# - 构建代理需求的问题未针对 android 构建进行验证

django - 无法在Docker上构建简单的Django应用(必须具有Postgres + Mysql支持)

ruby - jekyll 不更新 docker 开发容器中的静态 CSS、HTML 文件

docker - 为什么Docker容器退出时不保存?

.net - Azure Pipeline 构建失败

unit-testing - Azure DevOps 管道 : Tests that pass locally fail on the pipeline

Azure DevOps 发布管道 - 无法查看其他用户创建的自托管代理