Skip to contents

containr (development version)

containr 0.1.3.9000

New functions

  • build_image() builds a container image from a Dockerfile using either podman or docker. Auto-detects which tool is available, preferring podman. New platform argument defaults to "linux/amd64" for HPC/HTC cluster compatibility. When the target platform differs from the host architecture (e.g. building linux/amd64 on Apple Silicon), the function automatically uses docker buildx build with --load for Docker, or passes --platform directly for Podman. A warning is emitted for cross-platform builds to alert the user about potential QEMU emulation issues. Supports dry_run = TRUE to preview the build command without executing it. verbose and comments follow the same contract as generate_dockerfile().

  • push_image() tags a locally built container image with a full registry path and pushes it to a container registry in a single call, handling both the podman tag and podman push steps internally. Arguments: image_id, netid, project, tag (defaults to "latest"), registry (defaults to "registry.doit.wisc.edu"). Supports login verification, dry_run = TRUE, and guided output via verbose and comments.

  • list_images() returns a data frame of container images in the local image store, as reported by podman image ls or docker image ls. Useful for finding the image ID to pass to push_image() after building an image with build_image(). Prints the data frame to the console and returns it invisibly.

  • Two new internal helpers shared by build_image(), push_image(), and list_images(): .resolve_tool() auto-detects podman or docker on the PATH, and .check_tool_responsive() verifies the daemon is running before attempting any build, push, or list operation.

Changes to generate_dockerfile()

  • Breaking change: COPY instructions generated by data_file, code_file, and misc_file now preserve the local directory structure inside the container under /home/. Previously, all files were flattened into /home/data/ or /home/ regardless of their source path. For example, data_file = "data-raw/sample.csv" now produces COPY data-raw/sample.csv /home/data-raw/sample.csv instead of COPY data-raw/sample.csv /home/data/sample.csv. This means R scripts inside the container can use the same relative paths they use locally.

  • Breaking change: COPY source paths are now always written as relative to the build context (the current working directory). Previously, absolute paths could leak into the Dockerfile if .validate_file_arg() normalized them, causing podman build to fail with “no such file or directory.”

  • generate_dockerfile() refactored: r_mode validated before file and network operations, dplyr dependency removed, expose_port now warns when r_mode is not "rstudio", build loop simplified, invisible(NULL) added to return value.

  • generate_dockerfile() now requires an renv.lock file in the current working directory. Errors informatively if none is found, with instructions to run renv::snapshot().

  • New auto_syslibs argument (default TRUE) reads renv.lock, queries the Posit Package Manager sysreqs database via remotes::system_requirements(), and automatically includes the system libraries required by all packages in the lock file. Warns and continues without auto-detection if the lookup fails.

  • New install_syslibs argument (default NULL) accepts a character vector of additional apt package names to install on top of the auto-detected set, e.g. install_syslibs = c("libuv1-dev", "libwebp-dev").

  • curl is now always installed as a baseline system package regardless of auto_syslibs or install_syslibs. It is required by renv for package downloads inside the container.

  • Breaking change: the hardcoded system library list (cmake, libcurl4-openssl-dev, libssl-dev, etc.) has been removed. Libraries are now determined entirely by auto_syslibs and install_syslibs. The old install_syslibs = TRUE argument no longer works – pass a character vector of library names instead.

  • generate_dockerfile() now calls renv::status() defensively and warns if the lock file appears to be out of sync with the project library.

  • A success message now reports the path where the Dockerfile was written when verbose = TRUE.

Tests and documentation

  • Added tests/testthat/test-generate-dockerfile-content.R covering Dockerfile output content for all arguments.
  • Updated tests to expect directory-preserving COPY destinations instead of the old flattened /home/data/ pattern.
  • Added lifecycle and Codecov badges.
  • Updated hex sticker and favicon.
  • Added tests for build_image() platform parameter: invalid platform validation, --platform flag inclusion/omission, docker buildx vs docker build selection, --load flag for cross-arch Docker builds, cross-compilation warning, and same-architecture no-warning behavior.
  • .validate_file_arg() now returns paths relative to the working directory instead of absolute paths. Files outside the build context (including files on a different drive on Windows) produce an informative error. This fixes cross-drive build failures on Windows CI where fs::path_rel() could not compute a relative path

Dependency changes

  • httr2 added to Imports. Used by .get_r_ver_tags() for Docker Hub API calls.
  • httr removed from Imports. All HTTP calls now use httr2.
  • remotes added to Imports. Used by .fetch_sysreqs() to query system library requirements.
  • jsonlite added to Imports. Used by .read_renv_packages() to parse renv.lock.
  • dplyr removed from Imports. The r_mode lookup in generate_dockerfile() now uses a named vector instead of dplyr::case_when().

Internal changes

containr 0.1.3

CRAN release: 2026-04-26

Changes

Bug fixes

containr 0.1.2

CRAN release: 2026-04-07

  • Added inst/CITATION with DOI for proper academic citation via citation("containr")
  • Added inst/WORDLIST for spell check consistency
  • Added Language: en-US to DESCRIPTION
  • Improved documentation and README
  • Added rhub v2 GitHub Actions workflow for cross-platform checks

containr 0.1.1

CRAN release: 2025-09-24

containr 0.1.0

  • Initial CRAN submission.