PROFESSIONAL-CLOUD-DEVELOPER · Question #21
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. Ho
The correct answer is C. Use the digest of the Docker image.. A Docker image digest is a SHA256 content-addressable hash (e.g., sha256:abc123...) that is immutable and uniquely identifies one specific image layer manifest. Using a digest guarantees that every environment pulls the exact same bits regardless of when or where the pull occurs.
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?
Options
- AUse the latest Docker image tag.
- BUse a unique Docker image name.
- CUse the digest of the Docker image.
- DUse a semantic version Docker image tag.
How the community answered
(60 responses)- A5% (3)
- B10% (6)
- C83% (50)
- D2% (1)
Explanation
A Docker image digest is a SHA256 content-addressable hash (e.g., sha256:abc123...) that is immutable and uniquely identifies one specific image layer manifest. Using a digest guarantees that every environment pulls the exact same bits regardless of when or where the pull occurs. Tags like latest (option A) and semantic version tags (option D) are mutable pointers that can be reassigned to a different image at any time - someone could push a new image with the same tag between deployments. A unique image name (option B) alone does not pin a specific version. Digest-based references are the only guarantee of true immutability across environments.
Topics
Community Discussion
No community discussion yet for this question.