Migrate a Compute Engine app to GKE. Build a container image and push to Artifact Registry using Cloud Build. Which steps should you take? (Choose two.)
Choose an answer
Tap an option to check your answer.
Correct 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 defines the build steps for building and pushing the image..
Why this is the answer
To migrate an application to GKE using Cloud Build, you need to define the build process and then trigger it. The cloudbuild.yaml file specifies the steps Cloud Build should take, including building the container image (e.g., using Docker) and pushing it to Artifact Registry. This file must be located in the application's source directory. Once the cloudbuild.yaml is in place, the gcloud builds submit command is used to initiate the build process, sending the source code and the cloudbuild.yaml file to Cloud Build. The option gcloud run deploy is incorrect because it's used for deploying to Cloud Run, not for building and pushing images to Artifact Registry for GKE. The gcloud container images add-tag command is for adding tags to existing images, not for the initial build and push. The last incorrect option is subtly wrong because while Cloud Build pushes images to Artifact Registry, the term "publishing" is less precise in this context than "pushing" when referring to container images.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed