
Answer-first summary for fast verification
Answer: Run gcloud builds submit in the directory that contains the application source code., In the application source directory, create a file named cloudbuild.yaml that contains the following contents:
To migrate a Compute Engine application to GKE, building a container image and pushing it to Artifact Registry using Cloud Build requires two main steps. First, running `gcloud builds submit` (option A) triggers Cloud Build to use the Dockerfile in the source directory, building the image and pushing it to the specified registry. Second, creating a `cloudbuild.yaml` file (option E) is necessary to explicitly define the build steps and ensure the image is correctly tagged and pushed to Artifact Registry. Options B and C relate to deployment and image tagging, which are not relevant to the build and push process. Option D is incomplete without the contents of the file, making option E the correct choice as it is assumed to contain the necessary configuration for Artifact Registry.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
To migrate your Compute Engine application to Google Kubernetes Engine, you need to build a container image and push it to Artifact Registry using Cloud Build. Which two actions should you perform?
A
Run gcloud builds submit in the directory that contains the application source code.
B
Run gcloud run deploy app-name --image gcr.io/$PROJECT_ID/app-name in the directory that contains the application source code.
C
Run gcloud container images add-tag gcr.io/PROJECT_ID/app-name:latest in the directory that contains the application source code.
D
In the application source directory, create a file named cloudbuild.yaml that contains the following contents:
E
In the application source directory, create a file named cloudbuild.yaml that contains the following contents:
No comments yet.