Deploy a Cloud Run service directly from a self-contained source code archive (.tar.gz),
skipping the container image build step for faster deployment.
The archive must include all dependencies:
- For compiled languages (Go, Java), include pre-compiled binaries.
- For scripting languages (Python, Node.js), include pre-installed libraries (e.g., vendor/, node_modules/).
Deployment steps:
1. Package source code and dependencies into a .tar.gz archive (max 250MiB).
It's recommended to create archive from the root of the application's source directory.
2. Upload the archive to a Google Cloud Storage bucket, preferably in the same region as the service.
3. Deploy to Cloud Run using this tool, specifying:
- source_code: Google Cloud Storage object path to the archive (e.g., gs://bucket/object).
- command: Command to start the application.
- base_image_uri: Base image for the container (e.g., go124, nodejs24, python314).
See https://docs.cloud.google.com/run/docs/configuring/services/runtime-base-images for options.
The runtime picked should match the local environment.
- args: (Optional) Arguments for the command.
- env: (Optional) Environment variables (e.g., name: `PYTHONPATH`, value: `./vendor`).
- ports: (Optional) Container ports to expose (defaults to 8080).