Tagging Images
Part of the Introduction to Docker section of Coddy's Terminal journey — lesson 5 of 40.
A tag is a friendly label that points at an image. The docker tag command gives an existing image an additional name:
docker tag alpine:3.21 myalpine:v1This does not copy the image. It creates a new name, myalpine:v1, that refers to the same underlying image as alpine:3.21. Both now show up in docker images.
The format is docker tag SOURCE:TAG TARGET:TAG. Tags are how you give your own builds meaningful version names like v1, dev, or stable.
Challenge
EasyTag the ubuntu:24.04 image as myubuntu:stable, then run docker images myubuntu to confirm the new name exists.
Cheat sheet
The docker tag command creates an additional name for an existing image (no copy is made):
docker tag SOURCE:TAG TARGET:TAGBoth names will appear in docker images pointing to the same underlying image.
Try it yourself
This lesson includes a short quiz. Start the lesson to answer it and track your progress.