In our use of the docker workflow plugin we are seeing that volumes are being leaked when the container is removed. Is there an option that can be specified in a pipeline script that will result in the docker workflow plugin running the docker rm command with the -v option?
The problem that we are experiencing seems similar in nature to the following JIRA issues that have been open for some time.
https://issues.jenkins-ci.org/browse/JENKINS-46006
https://issues.jenkins-ci.org/browse/JENKINS-28646
We may be willing to contribute an enhancement to the plugin to support the -v option on the docker rm command if there isn’t a way to do that already. We are considering something along the lines of the following. Would this change be acceptable?
stage("Integration Tests") {
agent {
docker {
image("${params.KIND_DOCKER_CONTAINER}")
alwaysPull true
reuseNode true
removeVolume true // New parameter?
args "-u root --privileged -v ${env.WORKSPACE}:/workspace"
}
}
steps
{
...
}
}
Thanks,
Rob