Containerize Your 'R' Project

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/>.


containr

containr logo

R-CMD-check DOI CRANstatus CRANdownloads

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

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("containr")

0.1.3 by Erwin Lares, 6 months ago


https://github.com/erwinlares/containr, https://erwinlares.github.io/containr/


Report a bug at https://github.com/erwinlares/containr/issues


Browse source code at https://github.com/cran/containr


Authors: Erwin Lares [aut, cre]


Documentation:   PDF Manual  


Apache License (>= 2) license


Imports cli, dplyr, glue, httr, purrr, readr

Suggests spelling, testthat, withr


Suggested by submitr.


See at CRAN