I\'m using Jenkins in docker. The /var/jenkins_home is mounted on /var/jenkins-data on my host. My Jenkins can execute docker commands (mount of so
My last explanation was helping myself to solve the problem: This text helped me to solve it. I had to ensure that all the steps on my pipeline were using the same agent as the initial one where I performed my git clone:
Addit reuseNode true solved it:
stage('Build in Docker') {
agent {
docker {
image 'maven:3.5.2'
args '-v /var/jenkins_home/workspace/test:/opt/maven -w /opt/maven'
reuseNode true
}
}