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.)
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 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:
To build a container image and push it to Artifact Registry using Cloud Build, you should:
Run gcloud builds submit in the directory that contains the application source code. This command will trigger Cloud Build to build the container image and push it to Artifact Registry.
In the application source directory, create a file named cloudbuild.yaml that contains the instructions for building and pushing the container image. The file should contain the following steps:
steps:
-name: 'grc.io/cloud-builders/docker'
args: ['build','-t','grc.io/$PROJECT_ID','app-name','.']
-name: 'grc.io/cloud-builders/docker'
args: ['push','grc.io/$PROJECT_ID/app-name']
This file will be used by Cloud Build to build and push the container image.
B is incorrect because it uses the gcloud run deploy command, which is used to deploy a container image to Cloud Run, not to Artifact Registry.
C is incorrect because it uses the gcloud container images add-tag command, which is used to add a tag to an existing container image in Container Registry, not to build and push a new container image to Artifact Registry.
E is incorrect because it uses the gcloud app deploy command, which is used to deploy an application to App Engine, not to build and push a container image to Artifact Registry.
did anybody notice that D) has container URLs "gcr.io", which is container registry, not artifact registry?
not saying that there isn't a better alternative though
On further analysis Option A seems better than B as per this site . Correct options are A and D.
https://cloud.google.com/artifact-registry/docs/configure-cloud-build
D is correct, but I am confused between B and C, because question says about creating the container using cloud build, while option B states about the cloud run deployment.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
__rajan__
10 months, 2 weeks agoomermahgoub
1 year, 7 months agoomermahgoub
1 year, 7 months agozellck
1 year, 7 months agotomato123
1 year, 11 months agokinoko1330
1 year, 11 months agoakshaychavan7
1 year, 12 months agop4
2 years, 6 months agop4
2 years, 6 months agop4
2 years, 6 months agoBlueocean
2 years, 6 months agoBlueocean
2 years, 6 months agoscaenruy
2 years, 6 months agoParagSanyashiv
2 years, 6 months agoParagSanyashiv
2 years, 6 months ago