dock_from_renv {dockerfiler} | R Documentation |
Create a Dockerfile from an renv.lock
file
Description
Create a Dockerfile from an renv.lock
file
Usage
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
)
Arguments
lockfile |
Path to an |
distro |
|
FROM |
Docker image to start FROM Default is FROM rocker/r-base |
AS |
The AS of the Dockerfile. Default it |
sysreqs |
boolean. If |
repos |
character. The URL(s) of the repositories to use for |
expand |
boolean. If |
extra_sysreqs |
character vector. Extra debian system requirements. Will be installed with apt-get install. |
use_pak |
boolean. If |
user |
Name of the user to specify in the Dockerfile with the USER instruction. Default is |
dependencies |
What kinds of dependencies to install. Most commonly one of the following values:
|
sysreqs_platform |
System requirements platform. |
renv_version |
character. The renv version to use in the generated Dockerfile. By default, it is set to the version specified in the |
Details
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.
Value
A R6 object of class Dockerfile
.
Examples
## Not run:
dock <- dock_from_renv("renv.lock", distro = "xenial")
dock$write("Dockerfile")
## End(Not run)