Automatic Latest tag in private docker registry

3.4k Views Asked by At

I setup my own docker registry using this image: https://hub.docker.com/_/registry

The first thing I noticed was that the latest tag was not automatically being set. When pushing an image to dockerHub it gets assigned automatically the latest tag so you can always access the newest image with that tag.

That does not seem to be the default behaviour for a self-hosted docker registry. Is there any way to configure it so I get a latest-tag automatically?

1

There are 1 best solutions below

1
On

Even though Docker Hub behaves in that way, pushing latest tag automatically is not the default behavior for a Docker registry.

Usually, the action of pushing latest in addition to the tag that you are pushing is a custom logic that is a part of CI process set up for you app.

This is just one of many ways to achieve this

docker build -t myregistry.com/myapp:VARIABLE_TAG -t myregistry.com/myapp:latest .
docker push myregistry.com/myapp:VARIABLE_TAG
docker push myregistry.com/myapp:latest