$ show rocker-org/rocker-versioned2
This repository provides a build system for version-stable Rocker Docker images for R, including r-ver, rstudio, tidyverse, verse, shiny, shiny-verse, and geospatial. The core architecture uses R scripts to generate Dockerfiles from templates and docker-bake.json files from version matrices, enabling reproducible builds with fixed CRAN snapshots, RStudio Server versions, and CTAN dates. The CI/CD pipeline (GitHub Actions) automatically updates container definitions, builds multi-platform images (linux/amd64 and linux/arm64), and publishes them to Docker Hub and GitHub Container Registry. The repository also contains a collection of standalone installation scripts (rocker_scripts) that can be reused in downstream Dockerfiles to install R, RStudio Server, Shiny Server, tidyverse packages, geospatial libraries, Python, Julia, Jupyter, and more. These scripts are parameterized, idempotent, and follow best practices for Docker image layering. The build system itself is a well-engineered example of code generation and matrix-based CI, though it is tightly coupled to the Rocker project's specific versioning scheme.
The LLM identified 4 files worth highlighting for reuse:
Compiles a specified version of R from source on Ubuntu. Handles 'latest', 'devel', 'patched', and exact version numbers. Installs build dependencies, configures with BLAS/LAPACK, makes, installs, and cleans up. The script is self-contained, idempotent, and can be reused in any Ubuntu-based Docker image to install a fixed R version.
Downloads and installs RStudio Server for a given version (stable, preview, daily, or exact). Sets up the s6-overlay init system, configures RStudio to use the correct R binary, creates default user, and installs init scripts for container startup. The script is reusable in any Docker image that already has R installed.
A modified version of the littler install2.r script with added options for error handling, skipping missing packages, and parallel installation. It provides a robust command-line interface for installing R packages from CRAN or local files, with support for dependency resolution and installation options. This script is self-contained and can be copied to any system with R and littler.
Generates Dockerfiles from template files and version-specific arguments. Reads version matrices and variable tables, substitutes placeholders, and writes out Dockerfiles for each R version and image variant. Demonstrates a clean pattern for programmatic Dockerfile generation that could be adapted to other multi-version build systems.