Zeus
Zeus

Reputation: 1590

how to deploy docker image in gcp vm

I'm trying to deploy a simple R Shiny app containerized in a Docker image, onto a virtual machine hosted by Google Cloud Platform, but I'm having problems.

The files are stored on a Github repo and the Docker image is built using a trigger on GCP/Cloud Build. The Docker file is based on the rocker/shiny format.

The build is triggered correctly and starts to build, but the build keeps timing out after 10min.

TIMEOUT ERROR: context deadline exceeded

Is there a command I can add to the Dockerfile to extend the build time, or is my Dockerfile wrong?

Upvotes: 1

Views: 1778

Answers (1)

guille
guille

Reputation: 571

You can extend the timeout with a Cloud Build config (cloudbuild.yaml). The default timeout for a build is 10 minutes. Note that you define timeouts for each step as well as the entire build: https://cloud.google.com/cloud-build/docs/build-config

For your app, the cloudbuild.yaml would look something like

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

Upvotes: 5

Related Questions