W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
要部署到 Google Cloud Run,我們建議使用 JIB 來容器化您的應用程序。
使用 CLI
使用 JIB 創(chuàng)建應用程序:
$ mn create-app my-app --features jib
或者使用 Micronaut Launch
$ curl https://launch.micronaut.io/example.zip\?features\=jib -o example.zip $ unzip example.zip -d example
使用 JIB 設置將您的應用程序部署到 Google Container Registry,運行:
$ ./gradlew jib
您現(xiàn)在已準備好部署您的應用程序:
$ gcloud run deploy --image gcr.io/[PROJECT ID]/example --platform=managed --allow-unauthenticated
其中 ?[PROJECT ID]
? 是您的項目 ID。系統(tǒng)會要求您指定區(qū)域,并會看到如下輸出:
Service name: (example):
Deploying container to Cloud Run service [example] in project [PROJECT_ID] region [us-central1]
? Deploying... Done.
? Creating Revision...
? Routing traffic...
? Setting IAM Policy...
Done.
Service [example] revision [example-00004] has been deployed and is serving 100 percent of traffic at https://example-9487r97234-uc.a.run.app
URL 是您的 Cloud Run 應用程序的 URL。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: