How To Tag Docker Images
Docker
I’m migrating a few Docker containers between hosts and realised that one step that always needs to happen to any image is tagging – this will save you confusion and time in the future.
YouTube video: How To Tag a Docker Image
Update 12/2020: I just published a video about the same topic, hope it helps you understand this topic even better:
pS: if you like the video, check out Unix Tutorial Videos section!
How Untagged Docker Images Look
Without tags, you just see the Docker Image IDs in the list – that’s the only identifier you can use for spinning up Docker containers based on such images:
How To Tag Docker Images
Although it’s called tagging, technically this process allows you to specify a repository for your Docker image – effectively giving the image a name. If you want to specify that this is one of the many images belonging to a particular group or vendor, use / delimited notation like this:
Where unixtutorial is a group or organisation (repository) and web-server is its subsection.
In my examples I’m using my consultancy codename – techstack: techstack/confluence for the wiki engine and techstack/db for my custom build of MariaDB.
Simply run the docker tag command, first parameter is the image ID and second is the repository (with optional tag, by default it will be tag called “latest”):
You can tag or rename the same image more than once: in this case I’m tagging the same image with repository name techstack/confluence and tag “new”:
How Tagged Docker Images Look
This is much better now:
That’s it for today!
See Also
Docker
I’m migrating a few Docker containers between hosts and realised that one step that always needs to happen to any image is tagging – this will save you confusion and time in the future.
YouTube video: How To Tag a Docker Image
Update 12/2020: I just published a video about the same topic, hope it helps you understand this topic even better:
pS: if you like the video, check out Unix Tutorial Videos section!
How Untagged Docker Images Look
Without tags, you just see the Docker Image IDs in the list – that’s the only identifier you can use for spinning up Docker containers based on such images:
How To Tag Docker Images
Although it’s called tagging, technically this process allows you to specify a repository for your Docker image – effectively giving the image a name. If you want to specify that this is one of the many images belonging to a particular group or vendor, use / delimited notation like this:
Where unixtutorial is a group or organisation (repository) and web-server is its subsection.
In my examples I’m using my consultancy codename – techstack: techstack/confluence for the wiki engine and techstack/db for my custom build of MariaDB.
Simply run the docker tag command, first parameter is the image ID and second is the repository (with optional tag, by default it will be tag called “latest”):
You can tag or rename the same image more than once: in this case I’m tagging the same image with repository name techstack/confluence and tag “new”:
How Tagged Docker Images Look
This is much better now:
That’s it for today!