Docker - in CI/CDIn 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 pushBPush the same tag to both registries without retaggingCTag the image separately for each registry and push each tag after logging in to each registryDPush only to Docker Hub and rely on mirroringCheck Answer
Step-by-Step SolutionSolution:Step 1: Tag images for each registryUse separate tags with registry URLs to identify images for each registry.Step 2: Login and push to each registryAuthenticate to each registry and push the corresponding tagged image.Final Answer:Tag the image separately for each registry and push each tag after logging in to each registry -> Option CQuick 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 registriesBuilding image multiple times unnecessarilyAssuming mirroring is automatic
Master "in CI/CD" in Docker9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Docker Quizzes Docker Security - Scanning images for vulnerabilities - Quiz 5medium Docker Security - Content trust and image signing - Quiz 13medium Docker Security - Scanning images for vulnerabilities - Quiz 12easy Docker Swarm - Why orchestration matters - Quiz 8hard Docker Swarm - Deploying services in Swarm - Quiz 1easy Docker in CI/CD - Building images in CI pipeline - Quiz 7medium Docker in CI/CD - GitHub Actions with Docker - Quiz 12easy Image Optimization - Why image optimization matters - Quiz 12easy Logging and Monitoring - Prometheus for Docker monitoring - Quiz 8hard Resource Management - CPU limits and reservations - Quiz 5medium