Google Cloud Professional Cloud Developer Practice Test

Question: 1 / 400

To migrate a Compute Engine application to Google Kubernetes Engine, what are the necessary steps to build a container image and push it to Artifact Registry?

Run gcloud builds submit in the application source directory

To build a container image and push it to Artifact Registry, the first necessary step is to run `gcloud builds submit` from the application's source directory. This command triggers a Google Cloud Build that automates the process of building the container image based on the configuration and context provided by the source directory. During this process, Google Cloud Build will scan the Dockerfile located in the source directory (if present), build the image, and then upload it to the specified destination, which in this case would be Artifact Registry.

This step is crucial because it not only builds the image but also orchestrates the deployment of that image to a container registry, making it available for subsequent use in Google Kubernetes Engine (GKE). Without building the image and pushing it to a registry, the application would not be able to run in a containerized environment.

Other options describe steps that either do not directly accomplish the task of building and pushing the image or are steps that follow after the image has already been built or are related to different services. For instance, creating a cloudbuild.yaml file may define build steps but does not execute them, while using `gcloud run deploy` is specific to deploying applications on Google Cloud Run, and `gcloud container images add-tag`

Get further explanation with Examzify DeepDiveBeta

Create a docker build and push steps file named cloudbuild.yaml

Run gcloud run deploy in the application source directory

Add gcloud container images add-tag command in the application source directory

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy