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 219 discussion

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

You recently developed a new application. You want to deploy the application on Cloud Run without a Dockerfile. Your organization requires that all container images are pushed to a centrally managed container repository. How should you build your container using Google Cloud services? (Choose two.)

  • A. Push your source code to Artifact Registry.
  • B. Submit a Cloud Build job to push the image.
  • C. Use the pack build command with pack CLI.
  • D. Include the --source flag with the gcloud run deploy CLI command.
  • E. Include the --platform=kubernetes flag with the gcloud run deploy CLI command.
Show Suggested Answer Hide Answer
Suggested Answer: CD 🗳️

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
wanrltw
6 months, 3 weeks ago
Selected Answer: CD
C: “For example, use buildpacks to build the source code of your Cloud Run service into a container image.” - https://cloud.google.com/docs/buildpacks/build-application Also, https://cloud.google.com/blog/products/containers-kubernetes/google-cloud-now-supports-buildpacks D: “If no Dockerfile is present in the source code directory, Google Cloud's buildpacks automatically detects the language you are using and fetches the dependencies of the code to make a production-ready container image, using a secure base image managed by Google.” - https://cloud.google.com/run/docs/deploying-source-code
upvoted 2 times
wanrltw
6 months, 3 weeks ago
Not A, as it's redundant when using the option D: “You can also deploy directly from source to Cloud Run, which includes automatically creating a container image for your built source and storing the image in Artifact Registry.” - https://cloud.google.com/artifact-registry/docs/integrate-cloud-run B & E are irrelevant.
upvoted 1 times
...
...
82e0b6209c
7 months ago
Selected Answer: BC
The actual question is "How should you build your container using Google Cloud services?", so it doesn't mention how to deploy it. Also, if we exclude B, how is the image build in C ending up at the central container repository?
upvoted 2 times
...
purushi
10 months, 4 weeks ago
Selected Answer: CD
C is packeto build pack to create an image. This is a very efficient way of creating images explicitly. D is through gcloud run command. Not sure what framework cloud build uses to create an image.
upvoted 1 times
...
Pime13
1 year, 4 months ago
Selected Answer: CD
i choose cd
upvoted 1 times
...
mrvergara
1 year, 5 months ago
Selected Answer: CD
pack build [IMAGE-NAME] --builder [BUILDER-IMAGE] --path [APPLICATION-DIRECTORY] gcloud run deploy [SERVICE-NAME] --image [IMAGE-NAME] --source [APPLICATION-DIRECTORY]
upvoted 1 times
...
mrvergara
1 year, 5 months ago
Selected Answer: CD
https://cloud.google.com/run/docs/deploying-source-code
upvoted 1 times
...
omermahgoub
1 year, 5 months ago
Selected Answer: AB
A and B are the correct options because they both involve using Cloud Build to build the container image. Option A, Push your source code to Artifact Registry, allows you to store the source code of your application in a central location, making it easier to manage and version control. Option B, Submit a Cloud Build job to push the image, allows you to use Cloud Build to build the container image, which is a recommended method for building container images in a production environment. It allows you to automate the build process, test the image, and push it to a container registry.
upvoted 3 times
omermahgoub
1 year, 5 months ago
Option C, Use the pack build command with pack CLI, is not correct because Cloud Run does not support the use of the pack CLI. Option D, Include the --source flag with the gcloud run deploy CLI command, is not correct because this flag is used to specify the source code location when deploying the application, not building the container. Option E, Include the --platform=kubernetes flag with the gcloud run deploy CLI command, is not correct because this flag is used to specify the platform when deploying the application on Kubernetes and not Cloud Run.
upvoted 3 times
...
...
telp
1 year, 5 months ago
Selected Answer: CD
The Cloud run use the buildpacks to automatically build container images from source code but you need to use source code flag so you need to add the --source flag to your command gcloud run deploy --source=/PATH/ Answer C & D
upvoted 1 times
...
zellck
1 year, 6 months ago
Selected Answer: CD
CD is the answer. https://cloud.google.com/run/docs/deploying-source-code This page describes how to deploy new services and new revisions to Cloud Run directly from source code using a single gcloud CLI command, gcloud run deploy with the --source flag. Behind the scenes, this command uses Google Cloud's buildpacks and Cloud Build to automatically build container images from your source code without having to install Docker on your machine or set up buildpacks or Cloud Build.
upvoted 1 times
...
jcataluna
1 year, 6 months ago
Selected Answer: CD
C & D are correct
upvoted 2 times
...
x_cath
1 year, 6 months ago
C and D. C: Google Cloud for buildpacks—an open-source technology that makes it fast and easy for you to create secure, production-ready container images from source code and without a Dockerfile. https://cloud.google.com/blog/products/containers-kubernetes/google-cloud-now-supports-buildpacks (also mentioned by TNT87) D: Deploying from source code. "This page describes how to deploy new services and new revisions to Cloud Run directly from source code using a single gcloud CLI command, gcloud run deploy with the --source flag." https://cloud.google.com/run/docs/deploying-source-code A is incorrect because Artifact Registry is for container images, not source code. B is incorrect because only the built image is needed to be deployed to Cloud Run. "A centrally managed container repository" can be somewhere outside of Google, so as the build tool. It doesn't necessary to be built on Cloud Build. E is irrelevant in this case, as K8S is not involved in this question.
upvoted 4 times
x_cath
1 year, 6 months ago
Finally find something that excludes E as an answer: also in the buildpacks blog post, "these buildpacks produce container images that follow best practices and are suitable for running on all of our container platforms: Cloud Run (fully managed), Anthos, and Google Kubernetes Engine (GKE)" If it deploys to Cloud Run, it needs to be fully managed. Then the platform cannot be "kubernetes" - use the default value "managed" instead. See https://cloud.google.com/sdk/gcloud/reference/run/deploy#--platform
upvoted 1 times
TNT87
1 year, 6 months ago
Re-read the question, we simply need a method to deploy the application on Cloud Run without a Dockerfile.thats all
upvoted 1 times
...
TNT87
1 year, 6 months ago
Artifact registry, A
upvoted 1 times
TNT87
1 year, 6 months ago
Artifact Registry does not support Docker chunked uploads. Some tools support uploading large images with either chunked uploads or a single monolithic upload.
upvoted 1 times
...
...
...
...
kisswd
1 year, 7 months ago
Selected Answer: BC
https://dev.to/alvardev/gcp-cloud-run-containers-without-dockerfile-2jh3
upvoted 1 times
TNT87
1 year, 7 months ago
B, cant be.
upvoted 1 times
...
TNT87
1 year, 7 months ago
B is wrong sir
upvoted 1 times
...
...
TNT87
1 year, 7 months ago
Selected Answer: AC
Answer A https://cloud.google.com/run/docs/deploying#images Answer C https://cloud.google.com/blog/products/containers-kubernetes/google-cloud-now-supports-buildpacks
upvoted 1 times
zellck
1 year, 6 months ago
"Push your source code to Artifact Registry" -> GAR is not used for source code
upvoted 2 times
TNT87
1 year, 6 months ago
You clearly do not understand the question and the i dnt know if you have studied Devops? https://cloud.google.com/run/docs/deploying#images
upvoted 1 times
...
TNT87
1 year, 6 months ago
https://cloud.google.com/run/docs/deploying#images This will help you and if you have done Devops you will understand this
upvoted 1 times
...
TNT87
1 year, 6 months ago
How should you build your container using Google Cloud services? Its simply A, C
upvoted 1 times
zellck
1 year, 6 months ago
You cannot push source code to Artifact Registry. Cloud Source Repositories stores source code, while GAR stores build artifacts and dependencies.
upvoted 2 times
TNT87
1 year, 6 months ago
Note that source deployments use Artifact Registry to store built containers. If your project doesn't already have an Artifact Registry repository with the name cloud-run-source-deploy in the region you are deploying to, this feature automatically creates an Artifact Registry repository with the name cloud-run-source-deploy. Red this to understand, i can tell you have never done DevOps at all https://cloud.google.com/run/docs/deploying-source-code
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago