问题
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