What command can be used to deploy new services directly from source code in Cloud Run?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Prepare for the Google Cloud Professional Cloud Developer Test. Benefit from mock assessments featuring flashcards and multiple-choice format, each furnished with hints and detailed explanations. Excel in your exam with confidence!

The command gcloud run deploy --source is designed specifically for deploying services in Cloud Run directly from source code. When using this command, you simply specify the source code repository, and Google Cloud will automatically handle the building of the container image from that source code. This streamlines the deployment process, allowing developers to push updates without concerning themselves with the intermediate steps of building and deploying a Docker image manually.

The other commands mentioned are tailored for different contexts. Using --dockerfile implies you are deploying a service by directly referencing a Dockerfile, which requires that you already have a containerized version of your application ready. The --buildpack option is used to specify that a buildpack should be used to create the container image, which again presumes a level of pre-built configuration not necessary for a direct source code deployment. The command gcloud deploy from-source is not valid, as it does not conform to the recognized syntax of the gcloud command-line tool.

Therefore, gcloud run deploy --source is the most straightforward and efficient choice for deploying directly from source code in Cloud Run.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy