Image tags

A tag is a movable name for an image, like orders-api:1.4 or postgres:16. Several tags can point to the same image, and a tag can be moved to a new image at any time.

How it works

Without a tag, Docker assumes :latest, which is only a default name, not the newest version. Building again with the same tag moves the name to the new image; the old one keeps its layers but loses its name and shows up as <none>.

What breaks

Deploying :latest makes it impossible to know what runs or to roll back. Pin a version you chose (postgres:16.4, orders-api:1.4.2) so that a tag always means the same image.

In a terminal

docker tag orders-api orders-api:1.4.2
docker images orders-api

See it break, then fix it

Write the Dockerfile or the compose file, type the docker commands, and watch a simulated server run them through reboots, upgrades and traffic. Free to start.