Create a dockerfile from the current R session
Source: R/dockitect-from-environment.R
dk_from_session.RdGenerates a dockerfile based on the current R session's loaded packages
and environment, making it easy to containerize your current workflow.
Usage
dk_from_session(
base_image = NULL,
include_packages = TRUE,
include_sysreqs = TRUE,
package_manager = "auto"
)Details
This function:
Uses the current R version by default (or a specified base image)
Detects loaded packages in the current session
Adds necessary system requirements using the pak package
Adds commands to install the detected R packages
The resulting dockerfile will recreate an environment similar to your
current R session, making it easier to containerize your work.
See also
dk_from_renv() for creating from renv.lock files,
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_renv(),
dk_from_script()