Marketing Foundation
Compact two-skill starter: clarify positioning and choose a lead magnet. Use Marketing Launch for the broader eight-skill go-to-market workflow.
The tunnel uses the same cards as the catalogue. Browse only as deep as needed — or load a broad bundle immediately.
SEO, Sales, Agents or another broad area → one bundle call → work.
Read-only access to published skills. Default 8, maximum 10 skills / 120,000 characters.
Compact two-skill starter: clarify positioning and choose a lead magnet. Use Marketing Launch for the broader eight-skill go-to-market workflow.
Build an evidence-led marketing plan from ICP and competition through positioning, campaigns, growth and measurement.
Diagnose architecture and context, plan agent-team responsibilities, then organize project context and session handoffs. Memory and cost-runtime reviews remain outside this pack.
Review the journey from landing page and lead capture through registration, first value and transparent upgrades.
Plan a campaign, draft its channel content and review the work against actual brand guidance.
Prioritize an editorial roadmap and plan how to launch and distribute it across suitable channels.
Understand customer needs, compare competitors and plan a community around real member value.
Choose a relevant lead magnet, then draft a permission-based nurture journey with entry, suppression and exit rules.
Define the API contract, then plan how to observe its latency, failures and retries. Guidance and checklist; no production changes.
Profile a dataset, choose and interpret statistical methods, then validate calculations and conclusions before sharing.
Define the target account, prioritize buying signals, plan a human LinkedIn engagement routine and prepare evidence-led responses to buyer concerns.
Manages Cloud Run services, jobs, and worker pools. Use when you need to deploy applications
---
name: cloud-run-basics
metadata:
version: "1.0.0"
category: Serverless
description: >-
Manages Cloud Run services, jobs, and worker pools. Use when you need to deploy applications
responding to HTTP requests (services), run event-triggered or scheduled tasks (jobs),
or handle always-on pull-based background processing (worker pools).
---
# Cloud Run Basics
Cloud Run is a fully managed application platform for running your code,
function, or container on top of Google's highly scalable infrastructure. It
abstracts away infrastructure management, providing three primary resource
types:
1. **Services:** Responds to HTTP requests sent to a unique and stable
endpoint, using stateless instances that autoscale based on a variety of key
metrics, also responds to events and functions.
2. **Jobs:** Executes parallelizable tasks that are executed manually, or on a
schedule, and run to completion.
3. **Worker pools:** Handles always-on background workloads such as pull-based
workloads, for example, Kafka consumers, Pub/Sub pull queues, or RabbitMQ
consumers.
## Prerequisites
1. Enable the Cloud Run Admin API and Cloud Build APIs:
```bash
gcloud services enable run.googleapis.com cloudbuild.googleapis.com --quiet
```
1. If you are under a domain restriction organization policy [restricting](https://docs.cloud.google.com/organization-policy/restrict-domains.md.txt)
unauthenticated invocations for your project, you will need to access your
deployed service as described under [Testing private
services](https://docs.cloud.google.com/run/docs/triggering/https-request.md.txt).
### Required roles
You need the following roles to deploy your Cloud Run resource:
* Cloud Run Admin (`roles/run.admin`) on the project
* Cloud Run Source Developer (`roles/run.sourceDeveloper`) on the project
* Service Account User (`roles/iam.serviceAccountUser`) on the service
identity
* Logs Viewer (`roles/logging.viewer`) on the project
Cloud Build automatically uses the Compute Engine default service account as the
default Cloud Build service account to build your source code and Cloud Run
resource, unless you override this behavior.
For Cloud Build to build your sources, grant the Cloud Build service account the
Cloud Run Builder (`roles/run.builder`) role on your project:
```bash
gcloud projects add-iam-policy-binding PROJECT_ID \
--member=serviceAccount:SERVICE_ACCOUNT_EMAIL_ADDRESS \
--role=roles/run.builder \
--quiet
```
Replace `PROJECT_ID` with your Google Cloud project ID and
`SERVICE_ACCOUNT_EMAIL_ADDRESS` with the email address of the Cloud Build
service account.
## Deploy a Cloud Run service
You can deploy your service to Cloud Run by using a container image or deploy
directly from source code using a single Google Cloud CLI command.
> **CRITICAL RULE:** Any deployed code MUST listen on 0.0.0.0 (not 127.0.0.1)
> and use the injected $PORT environment variable (defaults to 8080), or it will
> crash on boot.
### Deploy a container image to Cloud Run
Cloud Run imports your container image during deployment. Cloud Run keeps this
copy of the container image as long as it is used by a serving revision.
Container images are not pulled from their container repository when a new Cloud
Run instance is started.
### Supported container images
You can directly use container images stored in the [Artifact
Registry](https://docs.cloud.google.com/artifact-registry/docs/overview.md.txt), or
[Docker Hub](https://hub.docker.com/). Google recommends the use of Artifact
Registry since Docker Hub images are
[cached](https://docs.cloud.google.com/artifact-registry/docs/pull-cached-dockerhub-images.md.txt)
for up to one hour.
You can use container images from other public or private registries (like JFrog
Artifactory, Nexus, or GitHub Container Registry), by setting up an [Artifact
Registry remote
repository](https://docs.cloud.google.com/artifact-registry/docs/repositories/remote-repo.md.txt).
You should only consider [Docker Hub](https://hub.docker.com/) for deploying
popular container images such as [Docker Official
Images](https://docs.docker.com/docker-hub/official_images/) or [Docker
Sponsored OSS images](https://docs.docker.com/docker-hub/dsos-program/). For
higher availability, Google recommends deploying these Docker Hub images using
an [Artifact Registry remote
repository](https://docs.cloud.google.com/artifact-registry/docs/repositories/remote-repo.md.txt).
To deploy a container image, run the following command:
```bash
gcloud run deploy SERVICE_NAME \
--image IMAGE_URL \
--region us-central1 \
--allow-unauthenticated \
--quiet
```
Replace the following:
* SERVICE_NAME: the name of the service you want to deploy to. Service names
must be 49 characters or less and must be unique per region and project. If
the service does not exist yet, this command creates the service during the
deployment. You can omit this parameter entirely, but you will be prompted
for the service name if you omit it.
* IMAGE_URL: a reference to the container image, for example,
`us-docker.pkg.dev/cloudrun/container/hello:latest`. If you use Artifact
Registry, the repository REPO_NAME must already be created. The URL follows
the format of `LOCATION-docker.pkg.dev/PROJECT_ID/REPO_NAME/PATH:TAG`. Note
that if you don't supply the `--image` flag, the deploy command will attempt
to deploy from source code.
### Deploy from source code
There are two different ways to deploy your service from source:
* Deploy from source with build (default): This option uses Google Cloud's
buildpacks and Cloud Build to automatically build container images from your
source code without having to install Docker on your machine or set up
buildpacks or Cloud Build. By default, Cloud Run uses the default machine
type provided by Cloud Build.
* To deploy from source with automatic base image updates enabled, run the
following command:
```bash
gcloud run deploy SERVICE_NAME --source . \
--base-image BASE_IMAGE \
--automatic-updates \
--quiet
```
Cloud Run only supports automatic base images that use [Google Cloud's
buildpacks base
images](https://docs.cloud.google.com/docs/buildpacks/base-images.md.txt).
* To deploy from source using a Dockerfile, run the following command:
```bash
gcloud run deploy SERVICE_NAME --source . --quiet
```
When you provide a Dockerfile, Cloud Build runs it in the cloud, and
deploys the service.
* Deploy from source without build (Preview): This option deploys artifacts
directly to Cloud Run, bypassing the Cloud Build step. This allows for rapid
deployment times. To deploy from source without build, run the following
command:
```bash
gcloud beta run deploy SERVICE_NAME \
--source APPLICATION_PATH \
--no-build \
--base-image=BASE_IMAGE \
--command=COMMAND \
--args=ARG \
--quiet
```
Replace the following:
* SERVICE_NAME: the name of your Cloud Run service.
* APPLICATION_PATH: the location of your application on the local file
system.
* BASE_IMAGE: the [runtime base image](https://docs.cloud.google.com/run/docs/configuring/services/runtime-base-images.md.txt)
you want to use for your application. For example,
`us-central1-docker.pkg.dev/serverless-runtimes/google-24-full/runtimes/nodejs24`.
You can also deploy a pre-compiled binary without configuring additional
language-specific runtime components using the OS only base image, such
as `osonly24`.
* COMMAND: the command that the container starts up with.
* ARG: an argument you send to the container command. If you use multiple
arguments, specify each on its own line.
For examples on deploying from source without build, see [Examples of
deploying from source without
build](https://docs.cloud.google.com/run/docs/deploying-source-code.md.txt).
## Create and execute a Cloud Run job
To create a new job, run the following command:
```bash
gcloud run jobs create JOB_NAME --image IMAGE_URL OPTIONS --quiet
```
Alternatively, use the deploy command:
```bash
gcloud run jobs deploy JOB_NAME --image IMAGE_URL OPTIONS --quiet
```
Replace the following:
* JOB_NAME: the name of the job you want to create. If you omit this
parameter, you will be prompted for the job name when you run the command.
* IMAGE_URL: a reference to the container image—for example,
`us-docker.pkg.dev/cloudrun/container/job:latest`.
* Optionally, replace OPTIONS with any of the following flags:
* `--tasks`: Accepts integers greater or equal to 1. Defaults to 1;
maximum is 10,000. Each task is provided the environment variables
`CLOUD_RUN_TASK_INDEX` with a value between 0 and the number of tasks
minus 1, along with `CLOUD_RUN_TASK_COUNT`, which is the number of
tasks.
* `--max-retries`: The number of times a failed task is retried. Once any
task fails beyond this limit, the entire job is marked as failed. For
example, if set to 1, a failed task will be retried once, for a total of
two attempts. The default is 3. Accepts integers from 0 to 10.
* `--task-timeout`: Accepts a duration like "2s". Defaults to 10 minutes;
maximum is 168 hours (7 days). For tasks using GPUs, the maximum
available timeout is 1 hour.
* `--parallelism`: The maximum number of tasks that can execute in
parallel. By default, tasks will be started as quickly as possible in
parallel.
* --execute-now: If set, immediately after the job is created, a job
execution is started. Equivalent to calling `gcloud run jobs create`
followed by `gcloud run jobs execute`.
In addition to these preceding options, you also specify more configuration
such as environment variables or memory limits.
For a full list of available options when creating a job, refer to the [`gcloud
run jobs
create`](https://docs.cloud.google.com/sdk/gcloud/reference/run/jobs/create)
command line documentation.
Wait for the job creation to finish. You'll see a success message upon a
successful completion.
To execute an existing job, run the following command:
```bash
gcloud run jobs execute JOB_NAME --quiet
```
If you want the command to wait until the execution completes, run the following
command:
```bash
gcloud run jobs execute JOB_NAME --wait --region=REGION --quiet
```
Replace the following:
* JOB_NAME: the name of the job.
* REGION: the region in which the resource can be found. For example,
`europe-west1`. Alternatively, set the `run/region` property.
## Deploy a worker pool
You can deploy a Cloud Run worker pool using container images or deploy directly
from the source.
### Deploy a container image
You can specify a container image with a tag (for example,
`us-docker.pkg.dev/my-project/container/my-image:latest`) or with an exact
digest (for example,
`us-docker.pkg.dev/my-project/container/my-image@sha256:41f34ab970ee...`).
### Supported container images
You can directly use container images stored in the [Artifact
Registry](https://docs.cloud.google.com/artifact-registry/docs/overview.md.txt), or
[Docker Hub](https://hub.docker.com/). Google recommends the use of Artifact
Registry since Docker Hub images are
[cached](https://docs.cloud.google.com/artifact-registry/docs/pull-cached-dockerhub-images.md.txt)
for up to one hour.
You can use container images from other public or private registries (like JFrog
Artifactory, Nexus, or GitHub Container Registry), by setting up an [Artifact
Registry remote
repository](https://docs.cloud.google.com/artifact-registry/docs/repositories/remote-repo.md.txt).
You should only consider [Docker Hub](https://hub.docker.com/) for deploying
popular container images such as [Docker Official
Images](https://docs.docker.com/docker-hub/official_images/) or [Docker
Sponsored OSS images](https://docs.docker.com/docker-hub/dsos-program/). For
higher availability, Google recommends deploying these Docker Hub images using
an [Artifact Registry remote
repository](https://docs.cloud.google.com/artifact-registry/docs/repositories/remote-repo.md.txt).
To deploy a container image, run the following command:
```bash
gcloud run worker-pools deploy WORKER_POOL_NAME --image IMAGE_URL --quiet
```
Replace the following:
* WORKER_POOL_NAME: the name of the worker pool you want to deploy to. If the
worker pool does not exist yet, this command creates the worker pool during
the deployment. You can omit this parameter entirely, but you will be
prompted for the worker pool name if you omit it.
* IMAGE_URL: a reference to the container image that contains the worker pool,
such as `us-docker.pkg.dev/cloudrun/container/worker-pool:latest`. Note that
if you don't supply the `--image` flag, the deploy command attempts to
deploy from source code.
Wait for the deployment to finish. Upon successful completion, Cloud Run
displays a success message along with the revision information about the
deployed worker pool.
### Deploy a worker pool from source
You can deploy a new worker pool or worker pool revision to Cloud Run directly
from source code using a single gcloud CLI command, `gcloud run worker-pools`
deploy with the `--source` flag.
The deploy command defaults to source deployment if you don't supply the
`--image` or `--source` flags.
Behind the scenes, this command uses [Google Cloud's
buildpacks](https://docs.cloud.google.com/docs/buildpacks/overview.md.txt) and Cloud
Build to automatically build container images from your source code without
having to install Docker on your machine or set up buildpacks or Cloud Build. By
default, Cloud Run uses the default machine type provided by Cloud Build.
To deploy a worker pool from source, run the following command:
```bash
gcloud run worker-pools deploy WORKER_POOL_NAME --source . --quiet
```
Replace `WORKER_POOL_NAME` with the name you want for your worker pool.
### What to do if a deployment fails:
1. **IAM/Permission Error:** Read
[iam-security.md](references/iam-security.md).
2. **Crash on Boot / Healthcheck failed:** Fetch the logs immediately using
`gcloud logging read "resource.labels.service_name=SERVICE_NAME" --limit=20`
to find the exact runtime error.
3. **Native Dependency Error (Node/Python):** If using `--no-build`, switch to
`--source .` (Buildpacks) to compile native extensions properly for Linux.
## Reference Directory
- [Core Concepts](references/core-concepts.md): Services vs. Jobs vs.
Worker pools, resource model, and auto-scaling behavior for services.
- [CLI Usage](references/cli-usage.md): Essential `gcloud run` commands for
deployment and management.
- [Client Libraries](references/client-library-usage.md): Using Google
Cloud client libraries to interact with Cloud Run.
- [MCP Usage](references/mcp-usage.md): Using the Cloud Run remote MCP
server.
- [Infrastructure as Code](references/iac-usage.md): Terraform examples for
services, jobs, worker pools, and IAM bindings.
- [IAM & Security](references/iam-security.md): Roles, service identities,
and ingress/egress controls.
- [Networking Best Practices & Cost Optimization](references/networking.md): Cost
optimization strategies, Direct VPC egress, IP address and port exhaustion
strategies, performance throughput tuning, and MTU settings.
*If you need product information not found in these references, use the
Developer Knowledge MCP server `search_documents` tool.*Manages Cloud Run services, jobs, and worker pools. Use when you need to deploy applications
Complete original Google guidance with source attribution and declared execution limits.
Use supplied evidence to plan, review or explain the relevant workflow within authorized scope.
Authorized project context, resource scope, current configuration evidence and a named decision owner.
The original is official Apache-2.0 guidance. It may show cloud commands, deployment examples or credential placeholders; those are not run, configured, installed, or authorized by loading this catalog entry. Verify current provider documentation and resource-owner approval before external changes.
Use Google Cloud Run Basics for [TASK]. Start from authorized project context and supplied evidence. Identify unknowns and propose changes for review; do not run commands, connect accounts, deploy, transfer data, or incur charges from this text alone.
Automatic cloud execution, credential handling, account access, deployments, destructive changes, or claims that examples are configured and verified.
M11 added German routing, integrity tracking and a strict no-execution boundary. Original attribution: Google (google/skills repository). The original is official Apache-2.0 guidance. It may show cloud commands, deployment examples or credential placeholders; those are not run, configured, installed, or authorized by loading this catalog entry. Verify current provider documentation and resource-owner approval before external changes.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Copy the text below, then paste it into your chat.