-
Bug
-
Resolution: Fixed
-
Blocker
the hash for the the image to be built is computed, however this not properly take into account that we may use the same Dockerfile just with different build arguments to change the resulting image.
// Work-around for Jenkins not killing/removing older queued jobs for (int i = 0; i < (BUILD_NUMBER as int); i++) {milestone()} // What follows is the actual pipeline that we want Jenkins to go and build, along with all of the stages pipeline { options { timeout(time: 1, unit: 'HOURS') timestamps() } agent none; stages { stage("Unit Testing") { parallel { stage("Python 3.7") { agent { dockerfile { filename 'Dockerfile.jenkins' additionalBuildArgs '--build-arg TAG=3.7' label 'docker' } } steps { sh 'tox -e py37' stash name: 'py37_coverage', includes: '.coverage.py37' } post { always { junit 'junit.xml' } } } stage("Python 3.6") { agent { dockerfile { filename 'Dockerfile.jenkins' additionalBuildArgs '--build-arg TAG=3.6' label 'docker' } } steps { sh 'tox -e py36' stash name: 'py36_coverage', includes: '.coverage.py36' } post { always { junit 'junit.xml' } } } } } } }
Will both build an image that is going to be tagged with the exact same sha hash, which means that either one of them is going to end up executing inside the wrong docker container.
18:57:26 -0600 + docker build -t 1d1e61023e37853427ab75fc92cac3ab6e0d4c58 --build-arg TAG=3.7 -f Dockerfile.jenkins . 18:57:26 -0600 + docker build -t 1d1e61023e37853427ab75fc92cac3ab6e0d4c58 --build-arg TAG=3.6 -f Dockerfile.jenkins .