Menu
Coddy logo textTech

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:v1

This 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 icon

Challenge

Easy

Tag 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:TAG

Both names will appear in docker images pointing to the same underlying image.

Try it yourself

Terminal
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Introduction to Docker