Is it possible for image to have multiple tags? Is it possible for image to have multiple tags? docker docker

Is it possible for image to have multiple tags?


You can build an image with several tags and then push the image with the --all-tags option.

Example:

docker build -t reg/user/image:foo -t reg/user/image:latest .docker push reg/user/image --all-tags

Older Docker clients that do not support --all-tags will push all tags by default (simply omit the option), newer clients will only push latest by default. As an alternative, you may want to push each tag separately.


You can create multiple tags:

docker tag <id> <user>/<image>:0.2docker tag <id> <user>/<image>:latest

and push these.


You need to do one push per each version like:

docker tag test:latest <repo>/<user>/test:latestdocker push <repo>/<user>/test:latestdocker tag test:0.2 <repo>/<user>/test:0.2docker push <repo>/<user>/test:0.2

You can also combine and say the latest version is 0.2 like:

docker tag <repo>/<user>/test:latest <repo>/<user>/test:0.2docker push <repo>/<user>/test:0.2

So those will point the same image layer.