Interview Prep/Docker/Multi-stage builds, cache, tags and registries

You tag every build `myapp:latest`. A rollback is requested. What happens?

BeginnerScenarioMulti-stage builds, cache, tags and registries
Answer

Situation read → latest was overwritten; the previous image is untagged ("dangling") or only in registry history.

What I'd do → Going forward tag with the git SHA and semantic version (app:1.8.2, app:git-3f2c1a9), deploy by digest, and keep latest only as a convenience. For the immediate rollback find the old digest in registry logs, a deploy manifest, or a node's docker image ls --digests.

Why → Immutable references make rollback a config change, not a rebuild.

Interview tip → Tags are mutable pointers; digests are content addresses.

All Docker questions Roadmap: Docker & containers

More on Multi-stage builds, cache, tags and registries