PROFESSIONAL-CLOUD-DEVELOPER · Question #51
You are using Cloud Build to build and test application source code stored in Cloud Source Repositories. The build process requires a build tool not available in the Cloud Build environment. What shou
The correct answer is B. Build a custom cloud builder image and reference the image in your build steps.. Cloud Build uses builder images (Docker containers) to execute build steps. When a required tool is not available in the default Cloud Build environment, the correct approach is to create a custom builder image that includes the necessary tool, push it to Artifact Registry (or Co
Question
You are using Cloud Build to build and test application source code stored in Cloud Source Repositories. The build process requires a build tool not available in the Cloud Build environment. What should you do?
Options
- ADownload the binary from the internet during the build process.
- BBuild a custom cloud builder image and reference the image in your build steps.
- CInclude the binary in your Cloud Source Repositories repository and reference it in your build
- DAsk to have the binary added to the Cloud Build environment by filing a feature request against
How the community answered
(36 responses)- A3% (1)
- B86% (31)
- C3% (1)
- D8% (3)
Explanation
Cloud Build uses builder images (Docker containers) to execute build steps. When a required tool is not available in the default Cloud Build environment, the correct approach is to create a custom builder image that includes the necessary tool, push it to Artifact Registry (or Container Registry), and reference it in your cloudbuild.yaml build steps. This is the officially supported, repeatable, and maintainable solution. Option A (downloading binaries at runtime) is fragile and a security risk. Option C (storing binaries in source repos) is bad practice since binaries in version control are unmanageable and insecure. Option D (filing a feature request) does not solve the immediate problem.
Topics
Community Discussion
No community discussion yet for this question.