Create a Dockerfile from an renv.lock
file
dock_from_renv(
lockfile = "renv.lock",
distro = NULL,
FROM = "rocker/r-base",
AS = NULL,
sysreqs = TRUE,
repos = c(CRAN = "https://cran.rstudio.com/"),
expand = FALSE,
extra_sysreqs = NULL,
use_pak = FALSE,
user = NULL,
dependencies = NA,
sysreqs_platform = "ubuntu",
renv_version
)
Path to an renv.lock
file to use as an input..
deprecated - only debian/ubuntu based images are supported
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.
boolean. If TRUE
use pak to deal with dependencies during renv::restore()
. FALSE by default
Name of the user to specify in the Dockerfile with the USER instruction. Default is NULL
, in which case the user from the FROM image is used.
What kinds of dependencies to install. Most commonly one of the following values:
NA
: only required (hard) dependencies,
TRUE
: required dependencies plus optional and development
dependencies,
FALSE
: do not install any dependencies. (You might end up with a
non-working package, and/or the installation might fail.)
System requirements platform.ubuntu
by default. If NULL
, then the current platform is used. Can be : "ubuntu-22.04" if needed to fit with the FROM
Operating System. Only debian or ubuntu based images are supported
character. The renv version to use in the generated Dockerfile. By default, it is set to the version specified in the renv.lock
file.
If the renv.lock
file does not specify a renv version,
the version of renv bundled with dockerfiler,
specifically 1.0.3, will be used.
If you set it to NULL
, the latest available version of renv will be used.
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) { # \dontrun{
dock <- dock_from_renv("renv.lock", distro = "xenial")
dock$write("Dockerfile")
} # }