exam questions

Exam Professional Cloud Developer All Questions

View all questions & answers for the Professional Cloud Developer exam

Exam Professional Cloud Developer topic 1 question 98 discussion

Actual exam question from Google's Professional Cloud Developer
Question #: 98
Topic #: 1
[All Professional Cloud Developer Questions]

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:
Show Suggested Answer Hide Answer
Suggested Answer: AD 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
__rajan__
10 months, 2 weeks ago
Selected Answer: AD
I will go with AD.
upvoted 1 times
...
omermahgoub
1 year, 7 months ago
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.
upvoted 2 times
omermahgoub
1 year, 7 months ago
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.
upvoted 2 times
...
...
zellck
1 year, 7 months ago
Selected Answer: AD
AD is the answer. https://cloud.google.com/build/docs/building/build-containers#store-images
upvoted 2 times
...
tomato123
1 year, 11 months ago
Selected Answer: AD
AD are correct
upvoted 2 times
...
kinoko1330
1 year, 11 months ago
Selected Answer: AD
https://cloud.google.com/build/docs/building/build-containers
upvoted 2 times
...
akshaychavan7
1 year, 12 months ago
Selected Answer: AD
Yup, it's A and D
upvoted 1 times
...
p4
2 years, 6 months ago
Selected Answer: AD
A to submit cloud build https://cloud.google.com/sdk/gcloud/reference/builds/submit D describes the cloud build steps (docker build + push)
upvoted 3 times
...
p4
2 years, 6 months ago
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
upvoted 1 times
p4
2 years, 6 months ago
ok seems it is now possible to use such domains (preview feature) https://cloud.google.com/artifact-registry/docs/transition/setup-gcr-repo
upvoted 1 times
...
...
Blueocean
2 years, 6 months ago
Agree with Option B and D
upvoted 1 times
Blueocean
2 years, 6 months ago
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
upvoted 2 times
...
...
scaenruy
2 years, 6 months ago
I vote A, D
upvoted 3 times
...
ParagSanyashiv
2 years, 6 months ago
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.
upvoted 1 times
ParagSanyashiv
2 years, 6 months ago
B seems more correct. B and D are more suitable
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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.

SaveCancel
Loading ...