Promoting Docker Images in Cloud Build | Identifying Docker Image in Build | SEO-friendly Page

How to Identify Docker Image in Cloud Build for Promotion | SEO-friendly Page

Question

You are using Cloud Build build to promote a Docker image to Development, Test, and Production environments.

You need to ensure that the same Docker image is deployed to each of these environments.

How should you identify the Docker image in your build?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

D.

To ensure that the same Docker image is deployed to each environment, it is important to identify the Docker image in a way that is unique and consistent across environments. Here are the options provided and what they mean:

A. Use the latest Docker image tag: This is not recommended as the "latest" tag can be overwritten by newer images with the same tag, resulting in different images being deployed to different environments.

B. Use a unique Docker image name: This is a viable option, but it can be difficult to manage if there are multiple versions of the same image. It also requires updating the deployment configuration for each environment with the correct image name.

C. Use the digest of the Docker image: This is the recommended option as the digest is a unique identifier for a Docker image that is generated based on the image's content. Using the digest ensures that the same image is deployed to each environment regardless of the tag or name.

D. Use a semantic version Docker image tag: This is another viable option, but it requires managing and updating the version numbers for each image. It also does not guarantee that the same image is deployed to each environment as different versions could be built with the same tag.

Therefore, the best option for identifying the Docker image in the build is to use the digest of the Docker image.