Google Professional Cloud Developer exam dumps

Google Professional Cloud Developer practice question 387 of 481

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

Google Professional Cloud Developer Question 387

Select 3Google Cloud Platform

You are tasked with building a container image for a Python-based web application using Google Cloud Build. The application requires dependencies listed in a requirements.txt file. Which of the following steps are required to correctly build the image using Cloud Build?

  1. A

    Create a cloudbuild.yaml file specifying the build steps to install dependencies and package the application.

  2. B

    Ensure that the Dockerfile is included in the application's root directory.

  3. C

    Execute the gcloud builds submit command, specifying the --tag flag to define the image name.

  4. D

    Manually install Python dependencies on your local machine before running the build process.

  5. E

    Use a prebuilt container image in Cloud Build without writing a Dockerfile or cloudbuild.yaml file.

Show answer and explanation

Correct answers: A, B, C

Explanation

To build a container image for a Python-based application using Cloud Build, you need to define the build steps in a cloudbuild.yaml file and include a Dockerfile for the build process. The gcloud builds submit command is then used to trigger the automated build. Manually installing dependencies or relying solely on prebuilt images is not suitable for this scenario, as the goal is to create a custom image for the application.

  • A. Correct.

    Correct: A cloudbuild.yaml file is required to define the steps for building the container image, such as installing dependencies and packaging the application.

  • B. Correct.

    Correct: A Dockerfile is necessary for defining how the container image is built, including installing dependencies and setting up the application runtime.

  • C. Correct.

    Correct: The gcloud builds submit command is used to trigger the build process in Cloud Build. The --tag flag ensures the built image is tagged appropriately.

  • D. Incorrect.

    Incorrect: Dependencies should not be manually installed on the local machine as the build process should be automated and self-contained.

  • E. Incorrect.

    Incorrect: While prebuilt images can be used, they are not appropriate for this scenario as you must create a custom image for the Python application.

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