The goal of dockerflow is to quickly generate containers for deployment.
You can install the released version of dockerflow from CRAN with:
install.packages("dockerflow")
This is a basic example which shows you how to solve a common problem:
library(dockerflow)
json_data <-
build_me_docker(name = 'DockerPlumber',
version = 'rocker/shiny:4.0.1',
packages = c('shiny'),
localpath_vector = 'app.R')
json_data
#> $json_path
#> .dockerflow.DockerPlumber.json
#>
#> $container
#> [
#> {
#> "base": [
#> "rocker/shiny:4.0.1"
#> ],
#> "name": [
#> "DockerPlumber"
#> ],
#> "workdir": [
#> "/"
#> ]
#> },
#> {
#> "apt_get": [
#> "sudo",
#> "gdebi-core",
#> "pandoc",
#> "pandoc-citeproc",
#> "libcurl4-gnutls-dev",
#> "libcairo2-dev",
#> "libxt-dev",
#> "xtail",
#> "wget",
#> "libssl-dev",
#> "libxml2-dev",
#> "python3-venv",
#> "libpq-dev",
#> "libsodium-dev",
#> "libudunits2-dev",
#> "libgdal-dev",
#> "systemctl",
#> "git",
#> "libssh2-1",
#> "libssh2-1-dev",
#> "unzip",
#> "curl"
#> ]
#> },
#> {
#> "packages": [
#> "shiny"
#> ],
#> "renv": {
#>
#> }
#> },
#> [
#> "app.R"
#> ]
#> ]
#>
build_container(dockerflow_path = json_data$json_path, build = TRUE)
#> # DockerPlumber
#> FROM rocker/shiny:4.0.1
#> WORKDIR /
#> RUN apt-get update --allow-releaseinfo-change -qq && apt-get install -y \
#> sudo \
#> gdebi-core \
#> pandoc \
#> pandoc-citeproc \
#> libcurl4-gnutls-dev \
#> libcairo2-dev \
#> libxt-dev \
#> xtail \
#> wget \
#> libssl-dev \
#> libxml2-dev \
#> python3-venv \
#> libpq-dev \
#> libsodium-dev \
#> libudunits2-dev \
#> libgdal-dev \
#> systemctl \
#> git \
#> libssh2-1 \
#> libssh2-1-dev \
#> unzip \
#> curl
#> RUN R -e "install.packages('shiny', dependencies = TRUE)"
#> COPY ./app.R ./app.R
#> please run tail -f .dockerfiles.txt to follow the installation
#> docker build -t dockerplumber --file ./DockerPlumber . >> .dockerfiles.txt