Jenkins concurrent builds on docker slaves

血红的双手。 提交于 2021-02-11 12:11:36

问题


I have a Jenkins Server (2.204.1) with Docker plugin (1.1.9) and a docker cloud API.

I work with Jenkins docker agents (slaves) And i map the docker slave build workspace between the container and the host in order to be able to path Artifacts to the downstream jobs.

in Jenkins Configuration - Docker Cloud Details - Container settings:

Volumes /var/lib/jenkins:/var/lib/jenkins

This works fine for a single build , The problem starts when i run concurrent builds, They are all mapped to the same workspace on the Docker host and interfering each other. What would be the best practice when using docker slaves and mapping workspace as a volume ?

I wouldn't like to use $CustomWorkspace or coping artifacts during the build as this is hard to manage and purge. I prefer the Jenkins regular slave approach of adding @2 to a second concurrent build but this is not the behavior when running concurrent builds on docker slaves

来源:https://stackoverflow.com/questions/61866110/jenkins-concurrent-builds-on-docker-slaves

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!