I have yet another issue with permissions running Docker through Jenkins declarative pipeline. I want to build and publish a Python package through a Jenkins job in a D
I have found what I myself would think is the prettier solution:
stage("Python Test") {
agent {
docker {
label "docker && linux"
image "python:3.7"
}
}
steps {
withEnv(["HOME=${env.WORKSPACE}"]) {
sh "pip install -r requirements.txt --user"
# python stuff
}
}
post {
cleanup {
cleanWs()
}
}
}
This workaround steers completely around the issue itself, installing the packages at user level. The issue here was that the HOME-directory was not initially writeable either, thus overwriting the HOME directory.