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.
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?BeginnerDisk 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