When dealing with images on the remote registry, the concept of tag is very important. We were going to find the images and identify those using tags. This is also crucial if you are going to publish your own image; you will need to tag it first. Let's do that now.
We use the docker tag
command to tag an image. You can identify an image you want to tag by either using its ID or its name. Also, you can pick the image to tag using other tags. The syntax of the docker tag
command is as follows:
docker tag IMAGE[:TAG] IMAGE[:TAG]
For example, you will need to execute the following command to tag a local image with name myHelloWorld
and tag test
into the myRepo
repository with version1.0.test
:
docker tag myHelloWorld:test myRepo/myHelloWorld:version1.0.test
If you run the docker images
command now, you will see your newly tagged image.
Your newly tagged image is now ready to be pushed to the remote registry. The concept of tags is used heavily by the Docker Hub's automated...