A cloud engineer needs to deploy a containerized web application to Google Cloud Run from local application source code in a newly created Google Cloud project. Place the operational steps in the correct execution sequence from first to last.
- 1Enable the Cloud Run API and Cloud Build API in the target project.
- 2Package the local source code into a container image and push it to Artifact Registry using `gcloud builds submit`.
- 3Deploy the container image to Cloud Run using `gcloud run deploy` specifying the image artifact location.
- 4Grant the `roles/run.invoker` IAM role to authorized callers using `gcloud run services add-iam-policy-binding`.
Cevap
The correct execution sequence is: 1. Enable the Cloud Run API and Cloud Build API. 2. Package and push the container image to Artifact Registry using gcloud builds submit. 3. Deploy the container image to Cloud Run using gcloud run deploy. 4. Grant the roles/run.invoker IAM role using gcloud run services add-iam-policy-binding.
The correct order follows the lifecycle dependencies of serverless container deployments on GCP. First, API enablement enables project capabilities. Second, Cloud Build compiles local code into a stored container artifact in Artifact Registry. Third, Cloud Run references that artifact to create a revision and endpoint. Fourth, IAM policy binding sets invoker access permissions on the created Cloud Run service.
Adım Adım Çözüm
Anahtar Kavram
Cloud Run deployment workflow from source code using gcloud CLI and Artifact Registry