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

How do you promote an image from dev to prod registry without rebuilding?

IntermediateScenarioMulti-stage builds, cache, tags and registries
Answer

Situation read → Same bytes must go to prod.

What I'd do →

docker buildx imagetools create \
  -t prod.example.com/app:1.8.2 dev.example.com/app@sha256:ab12...
# or
skopeo copy --all docker://dev.example.com/app@sha256:ab12... \
                  docker://prod.example.com/app:1.8.2
# or
crane copy dev.example.com/app@sha256:ab12... prod.example.com/app:1.8.2

Why → Digest equality proves what was tested is what runs; --all preserves multi-arch manifests.

Interview tip → docker pull/tag/push works but pulls only your platform.

All Docker questions Roadmap: Docker & containers

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