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

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 floating 1.8 and 1.
  • Environments reference digests via GitOps (image: app@sha256:...) with the tag in a comment.
  • latest only 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.

All Docker questions Roadmap: Docker & containers

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