- Beginner
- Containers and images
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.