jr00n
jr00n

Reputation: 471

docker doesn't get the latest images with tag latest

in my Dockerfile i have

FROM jenkins:latest

When I used it to build an image i've got some version from that moment (1.642.5). Now months later i want to rebuild the image with an updated jenkins version. I dropped (docker rmi) the image and rebuild (even with --no-cache=true) but still that old version is used instead of the latest 1.651.3

Now i've specified the correct version

FROM jenkins:1.651.3

and now the 'latest' is being downloaded and used.

Is this normal behaviour or a fault with the 'latest' tag at jenkins docker hub? https://hub.docker.com/_/jenkins/

Regards,

jr00n

Upvotes: 3

Views: 1175

Answers (1)

rindek
rindek

Reputation: 126

The reason your Dockerfile was using "elder" version was because once you had downloaded jenkins:latest image on your machine it was using its cached version every time you tried to build your own image. The --no-cache option means that your image will be build without using cache from already-built layers, but it will still use the "cache" from the base image.

If you wanted it to work properly you should either remove the base image - jenkins:latest or use --pull option when building.

Upvotes: 2

Related Questions