Deploying Application Versions from Google Container Registry - Best Practices for DevOps | PCDE Exam Guide

How to Specify Application Versions for Deployment from Google Container Registry

Question

Your application images are built using Cloud Build and pushed to Google Container Registry (GCR)

You want to be able to specify a particular version of your application for deployment based on the release version tagged in source control.

What should you do when you push the image?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C.

To be able to specify a particular version of your application for deployment based on the release version tagged in source control, you can use any of the following approaches:

A. Reference the image digest in the source control tag: When a container image is pushed to GCR, a unique digest is generated for the image, which is a hash value of the image contents. This digest can be used as a reference in the source control tag. This approach ensures that the exact version of the image is deployed, and there are no mismatches due to tag changes or renaming of the image.

B. Supply the source control tag as a parameter within the image name: Another approach is to include the source control tag as a parameter within the image name. This approach can be useful if you have a small number of images or if you do not want to use digest-based references. However, this approach can lead to confusion if the image names are changed or if the tags are renamed.

C. Use Cloud Build to include the release version tag in the application image: Cloud Build can be used to automatically include the release version tag in the application image during the build process. This approach ensures that the tag is always present in the image and eliminates the need for manually updating the source control tag.

D. Use GCR digest versioning to match the image to the tag in source control: GCR supports digest-based versioning, which allows you to use the digest of the image to refer to a specific version of the image. This approach can be used to match the image to the tag in source control, ensuring that the correct version of the image is deployed.

Out of the given options, Option A and Option D are viable approaches to specify a particular version of your application for deployment based on the release version tagged in source control. Option A uses the image digest to reference the image, while Option D uses digest versioning to match the image to the tag in source control. Both approaches ensure that the exact version of the image is deployed, and there are no mismatches due to tag changes or renaming of the image.