GCP Cloud Run — Deploy Containers Guide

Sanjeev SharmaSanjeev Sharma
1 min read

Advertisement

GCP Cloud Run — Deploy Containers Guide

Google Cloud Run enables serverless container deployment with automatic scaling.

Deploying Services

# Deploy container
gcloud run deploy my-service \
  --image gcr.io/my-project/my-app:latest \
  --platform managed \
  --region us-central1 \
  --allow-unauthenticated

# View service
gcloud run services list
gcloud run services describe my-service

# Stream logs
gcloud run services logs read my-service

Configuration

# Set environment variables
gcloud run deploy my-service \
  --image my-image \
  --set-env-vars FOO=bar,DEBUG=true

# Set memory/CPU
gcloud run deploy my-service \
  --image my-image \
  --memory 512Mi \
  --cpu 1

FAQ

Q: What's the cold start time? A: Usually < 1 second. First request slightly longer.

Q: Can I run background jobs? A: Cloud Run is for HTTP services. Use Cloud Tasks for async jobs.

Advertisement

Sanjeev Sharma

Written by

Sanjeev Sharma

Full Stack Engineer · E-mopro