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.
More on Multi-stage builds, cache, tags and registries
Show a multi-stage Dockerfile for a Java Spring Boot app and explain what you gain.BeginnerCI rebuilds from scratch every run and takes 12 minutes. How do you bring it down?IntermediateHow do you promote an image from dev to prod registry without rebuilding?IntermediateDisk on the build server keeps filling up with images.BeginnerWhen do you use `--no-cache` and when is it a smell?BeginnerExplain a build where `COPY` always misses the cache even though code did not change.Intermediate