Design a tagging strategy for a team that releases weekly.
IntermediateScenarioMulti-stage builds, cache, tags and registries
Answer
Situation read → Need traceability, rollback and human friendliness.
What I'd do →
- Every CI build:
app:<git-sha>(immutable, never re-pushed). - Releases:
app:1.8.2, plus floating1.8and1. - Environments reference digests via GitOps (
image: app@sha256:...) with the tag in a comment. latestonly for dev.- Registry tag immutability enabled (ECR, Harbor).
Why → Floating tags help consumers, immutable tags help operators.
Interview tip → Mention retention policies so old SHA tags age out.
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?IntermediateYou tag every build `myapp:latest`. A rollback is requested. What happens?BeginnerHow 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?Beginner