cloud-run-quickstart
npx skills add https://github.com/taeold/cloud-run-skills --skill cloud-run-quickstart
Agent 安装分布
Skill 文档
Cloud Run Quickstart
Help users deploy to Cloud Run with the optimal path for their needs.
Decision Tree
1. What’s your priority?
- Speed â No-Build Deploy (Fastest deploys ~10s)
- Simplicity â Buildpacks + ABIU (zero config, auto-updates)
- Control â Dockerfile or Container Image
2. What language?
No-Build (fastest): Best for languages like Go, Rust, Dart that support cross-platform compilation.Python/Node if no native bindings.
Buildpacks: Go, Node.js, Python, Java, .NET, Ruby, PHP
Quick Commands
No-Build (Go example)
GOOS=linux GOARCH=amd64 go build -o server .
gcloud beta run deploy SERVICE --source . --no-build --base-image go122 --command=./server --automatic-updates --region REGION
--sourcetriggers Cloud Build (~2-3 min). No-build and container image skip this.
Buildpacks + ABIU (Python example)
gcloud run deploy SERVICE --source . --base-image python313 --automatic-updates --region REGION
Dockerfile
gcloud run deploy SERVICE --source . --region REGION
Container Image
gcloud run deploy SERVICE --image REGION-docker.pkg.dev/PROJECT/REPO/IMAGE --region REGION
Required User Inputs
-
SERVICE: Must contain only lowercase letters, numbers, and hyphens. Reasonable default would be to use the name of the project/directory.
-
REGION: Reasonable default would be to use common region like us-west1 or europe-west4.
When to Use Each Path
- Quick demo or prototype app â No-Build
- Go/Rust or languages with strong cross-compilation â No-Build
- Standard prod app â Buildpacks + ABIU
- Custom OS packages â Dockerfile
- Docker-based CI/CD â Container Image
For detailed guides: See deployment-paths.md
Prerequisites
gcloud auth login
gcloud services enable \
run.googleapis.com \
cloudbuild.googleapis.com \
artifactregistry.googleapis.com \
storage.googleapis.com \
--project PROJECT_ID
Common Gotcha
App must listen on $PORT (8080 is a reasonable fallback):
port = int(os.environ.get('PORT', 8080))
Caveats
Native bindings: Python/Node apps with native extensions (ImageMagick, sharp, bcrypt) can’t use no-build. Use Buildpacks or Dockerfile.
Cross-compile: No-build requires linux/amd64 target. Make sure you use the right flags to target the right OS and architecture when compiling your app.