Check for newer Docker build for image

Viewed 8723

I'm running Jenkins from Docker with tag lts. behind this tag was version 2.73.2. Now there is a newer lts version available: 2.73.3. Docker doesn't automatically check for it. I had to do docker pull jenkins/jenkins:lts to get the new version.

But how can check if there is a newer build for a tag?

EDIT: I want to make clear: This is not a duplicate! I asked how to check for a newer Docker image available. I know how to upgrade (as I said above).

2 Answers

There is a project called Watchtower (https://github.com/v2tec/watchtower), which watches the running container and if there is a new version with the same tag available, it will pull the new image and restart the container.

Docker does not check for newer version of remote image. When building, Docker first check to see if the base image is in the local cache. If it find it is uses it, otherwise it tries to pull it from the remote repository.

I order to get latest image, you have to do it manually by running:

docker pull jenkins/jenkins:lts

Alternatively, you can disable the cache when building and always download the latest image by specifying the --no-cache option:

docker build --no-cache ...
Related