Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create multiple tag docker image

Tags:

docker

People also ask

Can Docker images have multiple tags?

In Docker, we can also assign multiple tags to an image. Here, we'll use the docker build command to assign multiple tags to an image in a single command.

How do I push multiple tags in Docker?

Use the -a (or --all-tags ) option to push all tags of a local image. The following example creates multiple tags for an image, and pushes all those tags to Docker Hub.

Can an ECR image have multiple tags?

You can build an image with several tags and then push the image with the --all-tags option. 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.


Since 1.10 release, you can now add multiple tags at once on build:

docker build -t name1:tag1 -t name1:tag2 -t name2 .

Source: Add ability to add multiple tags with docker build


You can't create tags with Dockerfiles but you can create multiple tags on your images via the command line.

Use this to list your image ids:

$ docker images

Then tag away:

$ docker tag 9f676bd305a4 ubuntu:13.10
$ docker tag 9f676bd305a4 ubuntu:saucy
$ docker tag eb601b8965b8 ubuntu:raring
...