jea*_*rme 13 docker google-cloud-platform google-container-registry google-cloud-run
我正在尝试将 Docker 映像拉入 Google Cloud Run。我看到我可能需要先将它拉到 Google Container Registry,但我能以某种方式避免它吗?另外,我宁愿直接从源头获得它以使其保持最新状态。
edd*_*dex 24
Google 更新了 Cloud Run 设置,现在支持开箱即用的 Docker Hub 映像。只需添加您的存储库路径(如果需要,请添加标签),无需任何区域/主机,它将从 Docker Hub 中提取。
gui*_*ere 18
我查看了该项目,最后我在 Cloud Run 上成功运行了它
首先,您不能在Google Container Registry或Artifact Registry之外拉取镜像。所以你需要拉图像,标记它并在 GCP 中推送它(你的项目与否,但在 GCP 上)
这里的步骤
# Pull the image (I did it on Cloud Shell)
docker pull thecodingmachine/gotenberg:6
# Tag the image
docker tag thecodingmachine/gotenberg:6 gcr.io/<MY_PROJECT_ID>/thecodingmachine/gotenberg:6
#Push the image (no authentication issue on Cloud Shell)
docker push gcr.io/<MY_PROJECT_ID>/thecodingmachine/gotenberg:6
# Deploy on Cloud Run
gcloud run deploy --image=gcr.io/<MY_PROJECT_ID>/thecodingmachine/gotenberg:6 \
--port=3000 --region=us-central1 --allow-unauthenticated --platform=managed \
--command=gotenberg gotenberg
Run Code Online (Sandbox Code Playgroud)
Cloud Run 部署的技巧是:
/tini
) 并且容器应该没有很好地构建,因为存在权限问题。Dockerfile 中的更多详细信息因此,请使用 Cloud Run URL 而不是http://localhost:3000
文档中的URL并享受!
归档时间: |
|
查看次数: |
1848 次 |
最近记录: |