Description
Containerize Your 'R' Project.
Description
Provides tools for containerizing 'R' projects. The core function, 'generate_dockerfile()', analyzes an 'R' project's environment and dependencies via an 'renv' lock file and generates a ready-to-use 'Dockerfile' that encapsulates the computational setup. Designed to help researchers build portable, reproducible workflows that can be reliably shared, archived, and rerun across systems. See R Core Team (2025) <https://www.R-project.org/>, Ushey et al. (2025) <https://CRAN.R-project.org/package=renv>, and Docker Inc. (2025) <https://www.docker.com/>.
README.md
containr

containr helps researchers containerize their R projects. Its core function, generate_dockerfile(), analyzes a project’s environment and dependencies via renv.lock and generates a ready-to-use Dockerfile — so analyses can be reliably shared, archived, and rerun across systems.
Installation
You can install containr from CRAN:
install.packages("containr")
Or install the development version from GitHub:
# install.packages("pak")
pak::pak("erwinlares/containr")
Usage
Below are common ways to use generate_dockerfile():
library(containr)
# Generate a Dockerfile with the latest R version and renv.lock dependencies
generate_dockerfile()
# Specify a particular R version
generate_dockerfile(r_version = "4.3.0")
# Use an RStudio Server image
generate_dockerfile(r_mode = "rstudio")
# Print progress messages during generation
generate_dockerfile(verbose = TRUE)
# Add explanatory comments to the generated Dockerfile
generate_dockerfile(comments = TRUE)
Citation
To cite containr in publications:
citation("containr")
License
Apache License (>= 2) © Erwin Lares.