- 登入 Google Cloud 帳戶。如果您是 Google Cloud新手,歡迎 建立帳戶,親自評估產品在實際工作環境中的成效。新客戶還能獲得價值 $300 美元的免費抵免額,可用於執行、測試及部署工作負載。
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
- 啟用 Cloud Run Admin API
- 安裝並初始化 gcloud CLI。
-
更新元件:
gcloud components update
-
(選用) 使用 gcloud 屬性設定平台和預設 Cloud Run 區域,避免指令列提示:
將 REGION 改為您要使用的預設區域。gcloud config set run/region REGION
-
或者,安裝 Docker,在本機建構 Docker 容器。您可以設定 Docker,使用 gcloud CLI 憑證輔助程式存取 Artifact Registry:
將gcloud auth configure-docker LOCATION-docker.pkg.dev
LOCATION替換為容器存放區的區域名稱,例如us-west2。
Cloud Run 地區
Cloud Run 具有「地區性」,這表示執行 Cloud Run 服務的基礎架構位於特定地區,並由 Google 代管,可為該地區內所有區域提供備援功能。
選擇 Cloud Run 服務的執行區域時,請將延遲時間、可用性或耐用性需求做為主要考量。一般而言,您可以選擇最靠近使用者的區域,但您應考量 Cloud Run 服務所使用的其他 Google Cloud產品位置。使用分散在不同位置的 Google Cloud 產品,可能會影響服務的延遲時間和費用。
Cloud Run 可在下列地區使用:
採用級別 1 定價
asia-east1(臺灣)asia-northeast1(東京)asia-northeast2(大阪)asia-south1(印度孟買)asia-southeast3(曼谷)europe-north1(芬蘭)二氧化碳排放量低
europe-north2(斯德哥爾摩)二氧化碳排放量低
europe-southwest1(馬德里)二氧化碳排放量低
europe-west1(比利時)二氧化碳排放量低
europe-west4(荷蘭)低二氧化碳排放2
europe-west8(米蘭)europe-west9(巴黎)低二氧化碳排放2
me-west1(特拉維夫)northamerica-south1(墨西哥)us-central1(愛荷華州)二氧化碳排放量低
us-east1(南卡羅來納州)us-east4(北維吉尼亞州)us-east5(哥倫布)us-south1(達拉斯)二氧化碳排放量低
us-west1(奧勒岡州)二氧化碳排放量低
採用級別 2 定價
africa-south1(約翰尼斯堡)asia-east2(香港)asia-northeast3(韓國首爾)asia-southeast1(新加坡)asia-southeast2(雅加達)asia-south2(印度德里)australia-southeast1(雪梨)australia-southeast2(墨爾本)europe-central2(波蘭華沙)europe-west10(柏林)europe-west12(杜林)europe-west2(英國倫敦)二氧化碳排放量低
europe-west3(德國法蘭克福)europe-west6(瑞士蘇黎世)二氧化碳排放量低
me-central1(杜哈)me-central2(達曼)northamerica-northeast1(蒙特婁)二氧化碳排放量低
northamerica-northeast2(多倫多)二氧化碳排放量低
southamerica-east1(巴西聖保羅)二氧化碳排放量低
southamerica-west1(智利聖地牙哥)二氧化碳排放量低
us-west2(洛杉磯)us-west3(鹽湖城)us-west4(拉斯維加斯)
如果您已建立 Cloud Run 服務,即可在 Google Cloud 控制台的 Cloud Run 資訊主頁中查看區域。
選用:使用 Cloud Code 工具開發新服務
您可以使用下列 Cloud Code 工具,建立新服務,而不必使用 Google Cloud 控制台或 Google Cloud CLI:
後續步驟
如要瞭解如何從程式碼來源建構容器、將容器推送至 Artifact Registry 並進行部署,請參閱: