PROFESSIONAL-CLOUD-DEVELOPER · Question #115
You have decided 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. What should you do? (Ch
The correct answer is A. Run gcloud builds submit 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. Cloud Build is triggered by running gcloud builds submit from the source directory (Choice A), which packages the source and sends it to Cloud Build. Choice D involves creating a cloudbuild.yaml file with the correct build steps - specifically, a Docker build step to build the im
Question
You have decided 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. What should you do? (Choose two.)
Options
- ARun gcloud builds submit in the directory that contains the application source code.
- BRun gcloud run deploy app-name --image gcr.io/$PROJECT_ID/app-name in the directory that
- CRun gcloud container images add-tag gcr.io/$PROJECT_ID/app-name gcr.io/$PROJECT_ID/app-
- DIn the application source directory, create a file named cloudbuild.yaml that contains the following
- EIn the application source directory, create a file named cloudbuild.yaml that contains the following
How the community answered
(38 responses)- A82% (31)
- B11% (4)
- C3% (1)
- E5% (2)
Explanation
Cloud Build is triggered by running gcloud builds submit from the source directory (Choice A), which packages the source and sends it to Cloud Build. Choice D involves creating a cloudbuild.yaml file with the correct build steps - specifically, a Docker build step to build the image and a push step to push it to Artifact Registry (using the gcr.io/$PROJECT_ID/app-name path or LOCATION-docker.pkg.dev/$PROJECT_ID/REPO/app-name). Together, A (the submit command) and D (the build configuration file) form the complete Cloud Build workflow. Choice B (gcloud run deploy) deploys to Cloud Run, not GKE. Choice C (gcloud container images add-tag) only adds a tag to an already-existing image - it doesn't build anything.
Topics
Community Discussion
No community discussion yet for this question.