Create a Dockerfile from an `renv.lock` file
dock_from_renv(
lockfile = "renv.lock",
distro = "focal",
FROM = "rocker/r-base",
AS = NULL,
sysreqs = TRUE,
repos = c(CRAN = "https://cran.rstudio.com/"),
expand = FALSE,
extra_sysreqs = NULL
)
Path to an `renv.lock` file to use as an input..
One of "focal", "bionic", "xenial", "centos7", or "centos8". See available distributions at https://hub.docker.com/r/rstudio/r-base/.
Docker image to start FROM Default is FROM rocker/r-base
The AS of the Dockerfile. Default it NULL.
boolean. If `TRUE`, the Dockerfile will contain sysreq installation.
character. The URL(s) of the repositories to use for `options("repos")`.
boolean. If `TRUE` each system requirement will have its own `RUN` line.
character vector. Extra debian system requirements. Will be installed with apt-get install.
A R6 object of class `Dockerfile`.
System requirements for packages are provided through RStudio Package Manager via the pak package. The install commands provided from pak are added as `RUN` directives within the `Dockerfile`.
The R version is taken from the `renv.lock` file. Packages are installed using `renv::restore()` which ensures that the proper package version and source is used when installed.
if (FALSE) {
dock <- dock_from_renv("renv.lock", distro = "xenial")
dock$write("Dockerfile")
}