About
A tag 1) is a string that identifies an image variant with
- a release version (1.0, 1.1)
- and/or other component (ie jdk11, jdk15, …)
Tag vs Digest
Technically, in the registry, all image addressing is content addressable, referenced by a digest known as immutable tags (currently sha256).
It is strongly recommended to use immutable tags in a production environment to ensures the deployment does not change automatically if the same tag is updated with a different image.
A Tag is the human readable version of it.
Note that you can push 2 different version to the same tag. The best example is the latest tag. Therefore, you can't be sure that the same tag will always pull the same image. Use the digest instead.
Example
In the case of the ubuntu image, there is multiple variants covering Ubuntu 10.04, 12.04, 12.10, 13.04, 13.10 and 14.04. Each variant is identified by a tag and you can refer to a tagged image like so:
ubuntu:14.04
Format
The tag:
- must be valid ASCII
- can contain:
- lowercase and uppercase letters,
- digits,
- underscores,
- periods,
- and hyphens.
- can't start with
- a period
- or hyphen
- must be no longer than 128 characters.
Default tag name
If you don't specify a tag, command uses latest as default.
Steps
- Tag
- Login to your repository (by default the docker hub)
docker login
- Push
docker push
Management
List
docker images command to see the image id and the newly tagged image.