I’m a new bee to Jenkins and Docker, and I’m facing a problem trying to get a docker image of maven to build my project.
My Jenkins script is as follows:
pipeline {
agent {
docker {
image 'maven:3-alpine'
args '-v /root/.m2:/root/.m2'
}
}
stages {
stage('Build') {
steps {
sh 'mvn -B -DskipTests clean install'
}
}
}
}
This results in the following error:
"Could not create local repository at /var/empty/.m2/repository".