Bird
0
0

In a CI pipeline, you want to push images to multiple registries (Docker Hub and a private registry). Which approach is best?

hard📝 Application Q9 of 15
Docker - in CI/CD
In a CI pipeline, you want to push images to multiple registries (Docker Hub and a private registry). Which approach is best?
ABuild the image twice, once for each registry, then push
BPush the same tag to both registries without retagging
CTag the image separately for each registry and push each tag after logging in to each registry
DPush only to Docker Hub and rely on mirroring
Step-by-Step Solution
Solution:
  1. Step 1: Tag images for each registry

    Use separate tags with registry URLs to identify images for each registry.
  2. Step 2: Login and push to each registry

    Authenticate to each registry and push the corresponding tagged image.
  3. Final Answer:

    Tag the image separately for each registry and push each tag after logging in to each registry -> Option C
  4. Quick Check:

    Separate tags and login per registry [OK]
Quick Trick: Tag and login separately for each registry [OK]
Common Mistakes:
  • Pushing same tag to different registries
  • Building image multiple times unnecessarily
  • Assuming mirroring is automatic

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes