Generates a dockerfile
based on an renv.lock file, ensuring reproducible
package dependencies in the container.
Usage
dk_from_renv(
lock_file = "renv.lock",
r_version = NULL,
base_image = NULL,
include_sysreqs = TRUE
)
Details
This function:
Extracts the R version from the lock file (if available)
Uses the appropriate rocker/r-ver base image
Adds system requirements for the packages in the lock file
Sets up renv and restores the packages from the lock file
The resulting dockerfile will recreate the exact environment specified in your renv.lock file, ensuring reproducible results.
See also
dk_from_session()
for creating from the current session,
dk_from_description()
for creating from DESCRIPTION files, &
dk_add_sysreqs()
for adding system requirements
Other dockerfile from environment functions:
dk_from_description()
,
dk_from_script()
,
dk_from_session()