Docker Latest tag to check if there is any changes on the upstream hub

While building docker images From other images with the tag latest. For example:

FROM alpine:latest

It checks the docker cache if there is an image labeled alpine:latest without checking if the image on docker hub is newer than the one in the cache.

I would like that any time you’re building from the latest explicitely, docker would compare the latest in the local machine cache as well as upstream and would pull a new version from the upstream if any. (in a similar fashion to the HEAD tag on git).

The --pull option on docker image build does exactly that.

docker build --help

Usage:	docker build [OPTIONS] PATH | URL | -

Build an image from a Dockerfile

      --pull         Always attempt to pull a newer version of the image
1 Like