Cloud Run 是一种全托管式应用平台,可让您运行可通过请求或事件进行调用的容器。Cloud Run 采用无服务器设计:您不用管理基础设施,因此可全力专注于最重要的工作,即构建出色的应用。了解详情。
获享 $300 免费赠金开始概念验证
-
体验 Gemini 2.0 Flash Thinking
-
免费使用热门产品(包括 AI API 和 BigQuery)的每月用量
-
不会自动收费,无需承诺
继续探索 20 多种提供“始终免费”用量的产品
使用适用于常见应用场景(包括 AI API、虚拟机、数据仓库等)的 20 多种免费产品。
培训
培训和教程
Pub/Sub 与 Cloud Run
了解如何通过 Pub/Sub 推送订阅编写、部署和调用 Cloud Run 服务。
培训
培训和教程
教程:处理来自 Cloud Storage 的图片
使用 Cloud Run、Cloud Vision API 和 ImageMagick 检测上传到 Cloud Storage 存储桶的令人反感的图片并对其进行模糊处理。
培训
培训和教程
教程:保护 Cloud Run 服务安全
创建一个在 Cloud Run 上运行且包含两个服务的安全应用。此应用是一个 Markdown 编辑器,它包含一个任何人都可以用来编写 Markdown 文本的公共“前端”服务和一个将 Markdown 文本渲染成 HTML 的专用“后端”服务。
培训
培训和教程
对 Cloud Run 服务进行本地问题排查
使用用于发现的 Google Cloud Observability 工具和用于调查的本地开发工作流来排查 Cloud Run 服务中断问题。此教程使用一个示例项目,部署该项目时会导致运行时错误,您可以通过问题排查来找到并解决问题。
培训
培训和教程
在 Cloud Run GPU 上使用 Gemma 3 和 Ollama 运行 LLM 推理
了解如何在支持 GPU 的 Cloud Run 服务上部署 Google 的 Gemma 3。
培训
培训和教程
Hello Cloud Run
此实验的目标是构建容器映像并将其部署到 Cloud Run。在此实验中,您将通过部署并运行无状态容器来了解如何开始使用 Cloud Run。
star
star
star
star
star_half
45 分钟
简介
5 个积分
培训
培训和教程
使用 Cloud Run 和 Pub/Sub 构建弹性异步系统
对于 Google Cloud Run 无服务器 Qwiklabs 挑战任务中的实验,您将了解每个实验中的虚构业务场景,并协助其中的人物实施无服务器解决方案。
star
star
star
star
star_half
1 小时
简介
7 个积分
使用场景
使用场景
Web 服务:REST API 后端
现代移动应用通常依赖 RESTful 后端 API 以提供应用数据的当前视图,并将前端和后端开发团队分离。借助 Cloud Run 上运行的 API 服务,开发者能够以可靠的方式在 Cloud SQL 或 Firestore (NoSQL) 等代管式数据库中保留数据。已登录 Cloud Run 的用户有权访问 Cloud 数据库中存储的应用资源数据。
Web 服务
API
Cloud SQL
Firestore
后端
使用场景
使用场景
Web 服务:网站后台管理
为了管理网站后台,通常需要使用文档、电子表格和其他自定义集成,还要运行供应商提供的 Web 应用。在 Cloud Run 上托管容器化的内部 Web 应用意味着该应用随时都可以使用,并且您只需在使用该应用时付费。
Web 服务
网站后台
管理
使用场景
使用场景
构建 Cloud Run 数据处理应用,以便在轻量级数据到达时进行转化并存储为结构化数据。转化可从 Google Cloud 来源触发。当一个 .csv 文件创建完毕时,系统会触发一个事件,并向 Cloud Run 服务传递该事件。然后,此服务会提取数据,对其进行结构化处理,并将其存储在 BigQuery 表中。
Web 服务
数据处理
结构化数据
转换
使用场景
使用场景
自动化:按计划生成文档
您可以利用 Cloud Scheduler 安排月度作业计划,使用 Cloud Run 服务生成账单。因为包含自定义二进制文件的容器可以部署到 Cloud Run,所以此类容器能够以无服务器的方式在 PDF 生成工具(例如 LibreOffice)内运行,这意味着您只需在生成账单时付费。
自动化
作业安排
使用场景
使用场景
自动化:使用网络钩子的业务工作流
采用事件驱动型的方式将您的操作关联在一起。Cloud Run 能够在实现网络钩子目标的同时按需扩缩,以请求的形式推送事件,并且仅在您接收和处理事件时向您收取费用。Cloud Run 服务可即时响应以触发您基础架构中的微服务,因此可在发生购买交易、作业已就绪或触发提醒时,对来自 GitHub 或 Slack 的事件做出响应或发送网络钩子。
自动化
业务工作流
网络钩子
事件
使用场景
使用场景
将 Node.js 应用从 Heroku 迁移到 Cloud Run
了解如何将 Heroku 上运行的 Node.js Web 应用迁移到 Google Cloud 上的 Cloud Run。本教程适合希望将应用从 Heroku 迁移到 Google Cloud 上的代管式服务的架构师和产品所有者。
Node.js
迁移
使用场景
使用场景
Google Cloud 上的 .NET 应用的现代化改造途径
本文档介绍单体式应用的常见限制以及对其进行现代化改造的逐步而结构化的流程。本文档适用于熟悉 Windows 和 .NET 生态系统并希望详细了解现代化改造所涉及的内容的云架构师、系统管理员以及 CTO。
.NET
现代化改造
迁移
代码示例
代码示例
从模板启动 Cloud Run 项目
从 Intellij 中的模板(包括 Flask、Django、Node.js、Java、Go 模板)启动应用。
代码示例
代码示例
Node.js 示例
包括 HelloWorld、Pub/Sub、Cloud SQL 示例、图片处理等等。
代码示例
代码示例
Python 示例
包括 HelloWorld、Pub/Sub、Cloud SQL 示例
代码示例
代码示例
Go 示例
包括 HelloWorld、Pub/Sub、Cloud SQL 示例、图片处理等等。
代码示例
代码示例
Java 示例
包括 HelloWorld、Pub/Sub、Cloud SQL 示例、图片处理等等。
代码示例
代码示例
.Net 版 HelloWorld
Cloud Run 的 .Net 版示例
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-21。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-21。"],[],[],null,["# Cloud Run documentation\n=======================\n\n[Read product documentation](/run/docs/overview/what-is-cloud-run)\nCloud Run is a fully managed application platform that lets you run\ncontainers that are invocable via requests or events.\nCloud Run is serverless: it abstracts away all\ninfrastructure management, so you can focus on what matters most---building\ngreat applications. [Learn more](/run/docs/overview/what-is-cloud-run).\n[Get started for free](https://console.cloud.google.com/freetrial) \n\n#### Start your proof of concept with $300 in free credit\n\n- Get access to Gemini 2.0 Flash Thinking\n- Free monthly usage of popular products, including AI APIs and BigQuery\n- No automatic charges, no commitment \n[View free product offers](/free/docs/free-cloud-features#free-tier) \n\n#### Keep exploring with 20+ always-free products\n\n\nAccess 20+ free products for common use cases, including AI APIs, VMs, data warehouses,\nand more.\n\nDocumentation resources\n-----------------------\n\nFind quickstarts and guides, review key references, and get help with common issues. \nformat_list_numbered\n\n### Guides\n\n-\n\n\n Quickstarts:\n [Service](/run/docs/quickstarts/deploy-container),\n\n [Job](/run/docs/quickstarts/jobs/create-execute),\n or\n [Function](/run/docs/quickstarts/functions/deploy-functions-console)\n\n\n-\n\n [Learn about the Cloud Run container runtime contract](/run/docs/container-contract)\n\n-\n\n [Deploy container images](/run/docs/deploying)\n\n-\n\n [Continuous deployment from Git](/run/docs/continuous-deployment-with-cloud-build)\n\n-\n\n [Deploy a function](/run/docs/deploy-functions)\n\n-\n\n [Map custom domains](/run/docs/mapping-custom-domains)\n\n-\n\n [Add authentication to Cloud Run apps](/run/docs/securing/identity-aware-proxy-cloud-run)\n\nfind_in_page\n\n### Reference\n\n-\n\n [gcloud commands](/sdk/gcloud/reference/run)\n\n-\n\n [Container runtime contract](/run/docs/reference/container-contract)\n\n-\n\n [IAM Roles](/run/docs/reference/iam/roles)\n\n-\n\n [Configuration options for Cloud Run services](/run/docs/configuring)\n\ninfo\n\n### Resources\n\n-\n\n [Pricing](/run/pricing)\n\n-\n\n [Release notes](/run/docs/release-notes)\n\n-\n\n [Locations](/run/docs/locations)\n\n-\n\n [Support](/run/docs/support)\n\nRelated resources\n-----------------\n\nTraining and tutorials \nUse cases \nCode samples \nExplore self-paced training, use cases, reference architectures, and code samples with examples of how to use and connect Google Cloud services. Training \nTraining and tutorials\n\n### Pub/Sub with Cloud Run\n\n\nLearn how to write, deploy, and call a Cloud Run service from a Pub/Sub push subscription.\n\n\n[Learn more](/run/docs/tutorials/pubsub) \nTraining \nTraining and tutorials\n\n### Processing images from Cloud Storage tutorial\n\n\nUse Cloud Run, Cloud Vision API, and ImageMagick to detect and blur offensive images uploaded to a Cloud Storage bucket.\n\n\n[Learn more](/run/docs/tutorials/image-processing) \nTraining \nTraining and tutorials\n\n### Securing Cloud Run services tutorial\n\n\nCreate a secure two-service application running on Cloud Run. This application is a Markdown editor which includes a public \"frontend\" service which anyone can use to compose markdown text, and a private \"backend\" service which renders Markdown text to HTML.\n\n\n[Learn more](/run/docs/tutorials/secure-services) \nTraining \nTraining and tutorials\n\n### Local troubleshooting of a Cloud Run service\n\n\nTroubleshoot a broken Cloud Run service using Google Cloud Observability tools for discovery and a local development workflow for investigation. This tutorial uses a sample project that results in runtime errors when deployed, which you troubleshoot to find and fix the problem.\n\n\n[Learn more](/run/docs/tutorials/local-troubleshooting) \nTraining \nTraining and tutorials\n\n### Run LLM inference on Cloud Run GPUs with Gemma 3 and Ollama\n\n\nLearn how to deploy Google's Gemma 3 on a GPU-enabled Cloud Run service.\n\n\n[Learn more](/run/docs/tutorials/gpu-gemma-with-ollama) \nTraining \nTraining and tutorials\n\n### Hello Cloud Run\n\n\nThe goal of this lab is for you to build a container image and deploying it to Cloud Run. In this lab, you'll learn how to get started with Cloud Run by deploying and running a stateless container.\n\n\nstar star star star star_half\n45 minutes introductory 5 credits\n\n\u003cbr /\u003e\n\n[Learn more\narrow_forward](https://www.cloudskillsboost.google/focuses/5162?parent=catalog) \nTraining \nTraining and tutorials\n\n### Build a Resilient, Asynchronous System with Cloud Run and Pub/Sub\n\n\nFor the labs in the Google Cloud Run Serverless Quest, you will read through a fictitious business scenario in each lab and assist the characters in implementing a serverless solution.\n\n\nstar star star star star_half\n1 hour introductory 7 credits\n\n\u003cbr /\u003e\n\n[Learn more\narrow_forward](https://www.cloudskillsboost.google/focuses/8389?parent=catalog) \nUse case \nUse cases\n\n### Web services: REST APIs backend\n\n\nModern mobile apps commonly rely on RESTful backend APIs to provide current views of application data and separation for frontend and backend development teams. API services running on Cloud Run allow developers to persist data reliably on managed databases such as Cloud SQL or Firestore (NoSQL). Logging in to Cloud Run grants users access to app‐resource data stored in Cloud Databases.\n\nWeb services API Cloud SQL Firestore backend\n\n\u003cbr /\u003e\n\n[Learn more](/run/docs/triggering/https-request) \nUse case \nUse cases\n\n### Web services: Back‐office administration\n\n\nBack‐office administration often requires documents, spreadsheets, and other custom integrations, and running a vendor‐supplied web application. Hosting the containerized internal web application on Cloud Run means it is always ready and you are only billed when it is used.\n\nWeb services back office administration\n\n\u003cbr /\u003e\n\n[Learn more](/run/docs/tutorials/identity-platform) \nUse case \nUse cases\n\n### Data processing: Lightweight data transformation\n\n\nBuild Cloud Run data processing applications that transform lightweight data as it arrives and store it as structured data. Transformations can be triggered from Google Cloud sources. When a .csv file is created, an event is fired and delivered to a Cloud Run service. Data is then extracted, structured, and stored in a BigQuery table.\n\nWeb services data processing structured data transformations\n\n\u003cbr /\u003e\n\n[Learn more](/run/docs/tutorials/image-processing) \nUse case \nUse cases\n\n### Automation: Scheduled document generation\n\n\nSchedule a monthly job with Cloud Scheduler to generate invoices using a Cloud Run service. Because containers containing custom binaries can be deployed to Cloud Run, it is able to run in a PDF generation tool like LibreOffice in a serverless way, which means only paying when you are generating invoices.\n\nAutomation job scheduling\n\n\u003cbr /\u003e\n\n[Learn more](/run/docs/triggering/using-scheduler) \nUse case \nUse cases\n\n### Automation: Business workflow with webhooks\n\n\nConnect your operations together with an event‐driven approach. Cloud Run scales on demand while implementing a webhook target, pushing events in the form of requests and only charging you when you receive and process the event. React to events from GitHub or Slack, or send webhooks when a purchase is made, a job is ready, or an alert is fired with a service that can react on a just‐in‐time basis to trigger a microservice in your infrastructure.\n\nAutomation business workflow webhooks events\n\n\u003cbr /\u003e\n\n[Learn more](/run/docs/triggering/webhooks) \nUse case \nUse cases\n\n### Migrating Node.js apps from Heroku to Cloud Run\n\n\nLearn how to migrate Node.js web apps that are running on Heroku to Cloud Run on Google Cloud. This tutorial is intended for architects and product owners who want to migrate their apps from Heroku to managed services on Google Cloud.\n\nNode.js Migration\n\n\u003cbr /\u003e\n\n[Learn more](/run/docs/migrate/migrating-nodejs-apps-from-heroku-to-cloud-run) \nUse case \nUse cases\n\n### Modernization path for .NET applications on Google Cloud\n\n\nThis document looks at the common limitations of monolithic applications and describes a gradual yet structured process for modernizing them. This document is intended for cloud architects, system administrators, and CTOs who are familiar with Windows and the .NET ecosystem and want to learn more about what modernization involves.\n\n.NET Modernization Migration\n\n\u003cbr /\u003e\n\n[Learn more](/solutions/modernization-path-dotnet-applications-google-cloud) \nCode sample \nCode Samples\n\n### Starting a Cloud Run project from a template\n\n\nStart your app from a template within Intellij, including Flask, Django, Node.js, Java, and Go templates.\n\n\n[Get started](/code/docs/intellij/creating-a-cloud-run-app) \nCode sample \nCode Samples\n\n### Node.js samples\n\n\nIncludes HelloWorld, Pub/Sub, Cloud SQL examples, image processing, and many others.\n\n\n[Open GitHub](https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/master/run/helloworld/) \nCode sample \nCode Samples\n\n### Python samples\n\n\nIncludes HelloWorld, Pub/Sub, and Cloud SQL examples\n\n\n[Open GitHub](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/run/) \nCode sample \nCode Samples\n\n### Go samples\n\n\nIncludes HelloWorld, Pub/Sub, Cloud SQL examples, image processing, and many others.\n\n\n[Open GitHub](https://github.com/GoogleCloudPlatform/golang-samples/tree/master/run/) \nCode sample \nCode Samples\n\n### Java samples\n\n\nIncludes HelloWorld, Pub/Sub, Cloud SQL examples, image processing, and many others.\n\n\n[Open GitHub](https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/run/) \nCode sample \nCode Samples\n\n### .Net HelloWorld\n\n\n.Net sample for Cloud Run\n\n\n[Open GitHub](https://github.com/GoogleCloudPlatform/dotnet-docs-samples/tree/main/run/helloworld)\n\nRelated videos\n--------------"]]