Docker Community Forums

Share and learn in the Docker community.

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


(Menajd) #1

Hello,
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).


(King Chung Huang) #2

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

Options:
      --pull         Always attempt to pull a newer version of the image