Google Cloud Professional Cloud Developer — Question 54
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?
Answer options
- A. Download the binary from the internet during the build process.
- B. Build a custom cloud builder image and reference the image in your build steps.
- C. Include the binary in your Cloud Source Repositories repository and reference it in your build scripts.
- D. Ask to have the binary added to the Cloud Build environment by filing a feature request against the Cloud Build public Issue Tracker.
Correct answer: B
Explanation
The correct answer is B, as building a custom cloud builder image allows you to include any necessary build tools that are not available in the default Cloud Build environment. Option A is incorrect because downloading binaries during the build can lead to inconsistencies and issues with build reproducibility. Option C is not ideal since including the binary in the repository can increase the repository size and complicate version management. Option D is not a practical solution, as it relies on external changes rather than utilizing the flexibility of custom images.