【问题标题】:how to deploy docker image in gcp vm如何在 gcp vm 中部署 docker 映像
【发布时间】:2019-05-06 17:09:22
【问题描述】:

我正在尝试将一个简单的 R Shiny 应用程序部署在 Docker 映像中容器化到由 Google Cloud Platform 托管的虚拟机上,但我遇到了问题。

文件存储在 Github repo 上,Docker 镜像是使用 GCP/Cloud Build 上的触发器构建的。 Docker 文件基于rocker/shiny 格式。

构建被正确触发并开始构建,但是构建在10分钟后一直超时。

TIMEOUT ERROR: context deadline exceeded

有没有可以添加到 Dockerfile 的命令来延长构建时间,还是我的 Dockerfile 错误?

【问题讨论】:

    标签: r docker shiny dockerfile google-cloud-build


    【解决方案1】:

    您可以使用 Cloud Build 配置 (cloudbuild.yaml) 延长超时时间。构建的默认超时为 10 分钟。请注意,您为每个步骤以及整个构建定义超时:https://cloud.google.com/cloud-build/docs/build-config

    对于您的应用,cloudbuild.yaml 看起来像

    steps:
    - name: 'gcr.io/cloud-builders/docker' 
      args: ['build', '--tag=gcr.io/$PROJECT_ID/linear', '.'] # build from Dockerfile
    images: ['gcr.io/$PROJECT_ID/linear'] # push tagged images to Container Registry
    timeout: '1200s' # extend timeout for build to 20 minutes
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-12
      • 1970-01-01
      • 1970-01-01
      • 2018-11-12
      • 2018-08-24
      • 1970-01-01
      相关资源
      最近更新 更多