Learn R Programming

googleCloudRunner (version 0.2.0)

cr_deploy_docker: Deploy a local Dockerfile to be built on ContainerRegistry

Description

Build a local Dockerfile in the cloud. See googleCloudRunner website for help how to generate Dockerfiles.

Usage

cr_deploy_docker(
  local,
  image_name = remote,
  dockerfile = NULL,
  remote = basename(local),
  tag = "$BUILD_ID",
  timeout = 600L,
  bucket = cr_bucket_get(),
  projectId = cr_project_get(),
  launch_browser = interactive(),
  ...
)

Arguments

local

The folder containing the Dockerfile to build

image_name

The name of the docker image to be built either full name starting with gcr.io or constructed from the image_name and projectId via gcr.io/{projectId}/{image_name}

dockerfile

An optional Dockerfile built to support the script. Not needed if 'Dockerfile' exists in folder. If supplied will be copied into deployment folder and called "Dockerfile"

remote

The folder on Google Cloud Storage

tag

The tag to attached to the pushed image - can use Build macros

timeout

Amount of time that this build should be allowed to run, to second

bucket

The GCS bucket that will be used to deploy code source

projectId

The projectId

launch_browser

Whether to launch the logs URL in a browser once deployed

...

Other arguments passed to cr_buildstep_docker

Details

This lets you deploy local folders with Dockerfiles, automating saving the source on Google Cloud Storage.

To deploy builds on git triggers and sources such as GitHub, see the examples of cr_buildstep_docker or the use cases on the website

See Also

Other Deployment functions: cr_deploy_git_html(), cr_deploy_github_docker(), cr_deploy_packagetests(), cr_deploy_pkgdown(), cr_deploy_run(), cr_deploy_r()

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
cr_project_set("my-project")
cr_region_set("europe-west1")
cr_email_set("123456@projectid.iam.gserviceaccount.com")
cr_bucket_set("my-bucket")

b <- cr_deploy_docker(system.file("example/", package="googleCloudRunner"))

# }

Run the code above in your browser using DataLab