Issue
I have a Jenkins pipeline described in a Jenkinsfile.
During the build step I start a docker container in which all build steps are executed. Something like this:
docker.image('node:8').inside() { }
I notice that this does not fetch the latest docker image but always uses the image that was originally pulled from the docker hub. I was expecting that this would check with the docker hub if the node:8
image is still up-to-date and fetch a new image if not. How can I trigger a new image download if my local registry does not have the latest image cached?
Solution
You can always pull the image, this will only download image layers that have changed:
sh 'docker pull node:8'
Answered By - yamenk