A backend team has built a stateless container image for a web microservice and pushed it to Artifact Registry at `us-docker.pkg.dev/my-project/apps/inventory-api:v1`. They want to quickly deploy this containerized application to Google Cloud Run and ensure it accepts public HTTP requests without requiring user authentication. Which `gcloud` command should they execute?
- gcloud run deploy inventory-api --image=us-docker.pkg.dev/my-project/apps/inventory-api:v1 --allow-unauthenticatedAnswer
- Bgcloud functions deploy inventory-api --image=us-docker.pkg.dev/my-project/apps/inventory-api:v1 --allow-unauthenticated
- Cgcloud run deploy inventory-api --image=us-docker.pkg.dev/my-project/apps/inventory-api:v1 --port=8080 --no-allow-unauthenticated
- Dgcloud run services update inventory-api --image=us-docker.pkg.dev/my-project/apps/inventory-api:v1 --to-latest
Answer
Execute `gcloud run deploy inventory-api --image=us-docker.pkg.dev/my-project/apps/inventory-api:v1 --allow-unauthenticated`.
To deploy a container image to Cloud Run and allow public access, run `gcloud run deploy` specifying the image location with `--image` and setting the `--allow-unauthenticated` flag.
Step-by-Step Solution
Key Concept
Deploying Serverless Applications with Cloud Run