containr 0.1.3.9000
New functions
build_image()builds a container image from aDockerfileusing eitherpodmanordocker. Auto-detects which tool is available, preferringpodman. Newplatformargument defaults to"linux/amd64"for HPC/HTC cluster compatibility. When the target platform differs from the host architecture (e.g. buildinglinux/amd64on Apple Silicon), the function automatically usesdocker buildx buildwith--loadfor Docker, or passes--platformdirectly for Podman. A warning is emitted for cross-platform builds to alert the user about potential QEMU emulation issues. Supportsdry_run = TRUEto preview the build command without executing it.verboseandcommentsfollow the same contract asgenerate_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 thepodman tagandpodman pushsteps 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 viaverboseandcomments.list_images()returns a data frame of container images in the local image store, as reported bypodman image lsordocker image ls. Useful for finding the image ID to pass topush_image()after building an image withbuild_image(). Prints the data frame to the console and returns it invisibly.Two new internal helpers shared by
build_image(),push_image(), andlist_images():.resolve_tool()auto-detectspodmanordockeron 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:
COPYinstructions generated bydata_file,code_file, andmisc_filenow 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 producesCOPY data-raw/sample.csv /home/data-raw/sample.csvinstead ofCOPY 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:
COPYsource 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, causingpodman buildto fail with “no such file or directory.”generate_dockerfile()refactored:r_modevalidated before file and network operations,dplyrdependency removed,expose_portnow warns whenr_modeis not"rstudio", build loop simplified,invisible(NULL)added to return value.generate_dockerfile()now requires anrenv.lockfile in the current working directory. Errors informatively if none is found, with instructions to runrenv::snapshot().New
auto_syslibsargument (defaultTRUE) readsrenv.lock, queries the Posit Package Manager sysreqs database viaremotes::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_syslibsargument (defaultNULL) accepts a character vector of additionalaptpackage names to install on top of the auto-detected set, e.g.install_syslibs = c("libuv1-dev", "libwebp-dev").curlis now always installed as a baseline system package regardless ofauto_syslibsorinstall_syslibs. It is required byrenvfor 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 byauto_syslibsandinstall_syslibs. The oldinstall_syslibs = TRUEargument no longer works – pass a character vector of library names instead.generate_dockerfile()now callsrenv::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
Dockerfilewas written whenverbose = TRUE.
Tests and documentation
- Added
tests/testthat/test-generate-dockerfile-content.Rcovering Dockerfile output content for all arguments. - Updated tests to expect directory-preserving
COPYdestinations instead of the old flattened/home/data/pattern. - Added lifecycle and Codecov badges.
- Updated hex sticker and favicon.
- Added tests for
build_image()platformparameter: invalid platform validation,--platformflag inclusion/omission,docker buildxvsdocker buildselection,--loadflag 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 wherefs::path_rel()could not compute a relative path
Dependency changes
-
httr2added toImports. Used by.get_r_ver_tags()for Docker Hub API calls. -
httrremoved fromImports. All HTTP calls now usehttr2. -
remotesadded toImports. Used by.fetch_sysreqs()to query system library requirements. -
jsonliteadded toImports. Used by.read_renv_packages()to parserenv.lock. -
dplyrremoved fromImports. Ther_modelookup ingenerate_dockerfile()now uses a named vector instead ofdplyr::case_when().
Internal changes
-
.get_r_ver_tags()migrated fromhttrtohttr2. - New internal helpers
.read_renv_packages()and.fetch_sysreqs()added inR/sysreqs-helpers.R. - New internal helpers
.resolve_tool()and.check_tool_responsive()added inR/container-helpers.R.
containr 0.1.3
CRAN release: 2026-04-26
Changes
- Internal helpers renamed with a dot prefix:
get_r_ver_tags()->.get_r_ver_tags(),r_ver_exists()->.r_ver_exists(), andvalidate_file_arg()->.validate_file_arg(). These are not user-facing but the change enforces the package convention for internal functions. -
tidystudioadded as a validr_modeingenerate_dockerfile(),.get_r_ver_tags(), and.r_ver_exists(). Maps torocker/verse.
Bug fixes
-
generate_dockerfile(): replacedstop()andprint()/Sys.sleep()calls withcli::cli_abort()andcli::cli_inform()throughout for consistent, styled error and progress messages. -
generate_dockerfile(): fixedcommentscondition for Quarto block fromquarto_install_line == TRUEtoinstall_quarto. -
generate_dockerfile(): fixedcommentsconditions forcode_fileandmisc_fileblocks to check the correct variables. -
generate_dockerfile(): RStudio run instructions split into two cleaner comment lines. -
.get_r_ver_tags(): replacedstopifnot()withcli::cli_abort()andmessage()withcli::cli_inform(). Removed barereturn()from final list expression. -
.r_ver_exists(): replacedstop()withcli::cli_abort()andmessage()withcli::cli_inform(). -
.validate_file_arg(): replacedstop()withcli::cli_abort().
containr 0.1.2
CRAN release: 2026-04-07
- Added
inst/CITATIONwith DOI for proper academic citation viacitation("containr") - Added
inst/WORDLISTfor spell check consistency - Added
Language: en-UStoDESCRIPTION - Improved documentation and README
- Added rhub v2 GitHub Actions workflow for cross-platform checks
