
Answer-first summary for fast verification
Answer: Configure a trigger in Cloud Build for new source changes. Invoke Cloud Build to build container images for each microservice, and tag them using the code commit hash. Push the images to the Container Registry.
Option A is the correct answer because it aligns with Google's best practices for continuous integration and container management. It uses Cloud Build triggers for automation on source changes, builds container images for each microservice (maintaining separation), tags them with the code commit hash for precise version tracking and traceability, and pushes to Container Registry (now Artifact Registry), which is the proper service for storing container images. Option B is incorrect because it pushes images to Cloud Storage instead of Container Registry, which is not suitable for container images. Option C is inefficient due to polling every minute instead of using triggers, and timestamp tagging is less reliable than commit hashes for versioning. Option D is problematic because using the 'latest' tag can cause deployment issues and lacks version specificity, making rollbacks and debugging difficult.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You are building a microservice-based application using Docker containers for TerramEarth. You want to implement a continuous integration process to build the application and store the resulting artifacts, following Google-recommended practices. What should you do?
A
Configure a trigger in Cloud Build for new source changes. Invoke Cloud Build to build container images for each microservice, and tag them using the code commit hash. Push the images to the Container Registry.
B
Configure a trigger in Cloud Build for new source changes. The trigger invokes build jobs and build container images for the microservices. Tag the images with a version number, and push them to Cloud Storage.
C
Create a Scheduler job to check the repo every minute. For any new change, invoke Cloud Build to build container images for the microservices. Tag the images using the current timestamp, and push them to the Container Registry.
D
Configure a trigger in Cloud Build for new source changes. Invoke Cloud Build to build one container image, and tag the image with the label 'latest.' Push the image to the Container Registry.