Google Professional Cloud Developer exam dumps

Google Professional Cloud Developer practice question 385 of 481

Professional Cloud Developer. Professional level, Google Cloud. Free question with the correct answer and a full explanation.

Google Professional Cloud Developer Question 385

Select 4Google Cloud Platform

You are tasked with building a container image for your application using Google Cloud Build. The application source code is stored in a GitHub repository. You need to ensure that the container image is automatically built and stored in Google Container Registry (GCR) whenever there is a new commit to the main branch. Which steps should you take to achieve this?

  1. A

    Create a Cloud Build trigger that listens to the main branch in the GitHub repository.

  2. B

    Write a cloudbuild.yaml file defining the build steps and store it in the root directory of the repository.

  3. C

    Manually run the build process in Cloud Build after every commit to the main branch.

  4. D

    Configure the trigger to push the built image to Google Container Registry (GCR).

  5. E

    Grant the Cloud Build service account permissions to push images to Google Container Registry.

Show answer and explanation

Correct answers: A, B, D, E

Explanation

To automate the process of building and storing a container image in Google Container Registry, you need to set up a Cloud Build trigger that listens to changes in the main branch of the GitHub repository. The cloudbuild.yaml file defines the build steps, which Cloud Build executes upon triggering. Additionally, the trigger should be configured to push the resulting image to GCR, and the Cloud Build service account must have permissions to perform this operation. Manually triggering builds after every commit is unnecessary when using triggers.

  • A. Correct.

    Correct. A Cloud Build trigger must be created to listen to changes in the main branch of the GitHub repository. This ensures the build process is automated.

  • B. Correct.

    Correct. The cloudbuild.yaml file defines the build steps that Cloud Build will execute to construct the container image.

  • C. Incorrect.

    Incorrect. Manually running the build process is not required when using triggers. The goal is to automate builds upon new commits.

  • D. Correct.

    Correct. The trigger configuration must include instructions to push the container image to GCR after the build process is complete.

  • E. Correct.

    Correct. Cloud Build requires appropriate permissions to push the built container image to GCR.

Timed practice exam

Take a Google Professional Cloud Developer practice test under exam conditions

60 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam