Archive · GCP

GCP Services: Cloud Run and Artifact Registry

Deploy a container with no servers to manage, from a private registry.

1 min read

  • Cloud Run
  • Artifact Registry
  • Cloud Build

Google’s older Container Registry shut down on 18 March 2025; use Artifact Registry.

gcloud services enable artifactregistry.googleapis.com run.googleapis.com cloudbuild.googleapis.com
gcloud artifacts repositories create apps --repository-format=docker --location=asia-south1
gcloud auth configure-docker asia-south1-docker.pkg.dev

docker build -t asia-south1-docker.pkg.dev/demo-ci-2025/apps/shop-api:1.0 .
docker push asia-south1-docker.pkg.dev/demo-ci-2025/apps/shop-api:1.0

Deploy to Cloud Run:

gcloud run deploy shop-api \
  --image asia-south1-docker.pkg.dev/demo-ci-2025/apps/shop-api:1.0 \
  --region asia-south1 --min-instances 0 --max-instances 5 \
  --no-allow-unauthenticated

Cloud Run scales from zero, bills per request time, and gives each service an HTTPS URL. Use --no-allow-unauthenticated plus IAM (roles/run.invoker) for private services. Set secrets from Secret Manager with --set-secrets.

For a build service, gcloud builds submit --tag ... runs Cloud Build. Cloud Functions 2nd generation is now Cloud Run functions, built on the same platform. Compare with AWS: Cloud Run sits between Lambda and Fargate.