/rocker-versioned2

Run current & prior versions of R using docker. rocker/r-ver, rocker/rstudio, rocker/shiny, rocker/tidyverse, and so on.

Primary LanguageDockerfileGNU General Public License v2.0GPL-2.0

license Project Status: Active – The project has reached a stable, usable state and is being actively developed. Update container definition files Build & Push Core images Build & Push R devel images and RStudio daily build images

Visit rocker-project.org for more about available Rocker images, configuration, and use.

Version-stable Rocker images

Overview

This repository provides rocker/r-ver and its derived images, alternate stack to r-base, with an emphasis on reproducibility.

Compared to r-base, this stack:

  • Builds on Ubuntu LTS rather than Debian and system libraries are tied to the Ubuntu version. Images will use the most recent LTS available at the time when the corresponding R version was released. Thus all 4.0 images are based on Ubuntu 20.04 (ubuntu:focal).
  • Installs a fixed version of R itself from source, rather than whatever is already packaged for Ubuntu (the r-base stack gets the latest R version as a binary from Debian unstable).
  • The only platforms available are linux/amd64 and linux/arm64 (arm64 images are experimental and only available for rocker/r-ver 4.1.0 or later).
  • Set the RStudio Public Package Manager (RSPM) as default CRAN mirror. For the amd64 platform, RSPM serves compiled Linux binaries of R packages and greatly speeds up package installs.
  • Non-latest R version images installs all R packages from a fixed snapshot of CRAN mirror at a given date. This setting ensures that the same version of the R package is installed no matter when the installation is performed.
  • Provides images that are generally smaller than the r-base series.

Note: This repository is for R >= 4.0.0 images. For images with R <= 3.6.3, please see the rocker-versioned repository, or the shiny, geospatial, and binder repositories.

Pre-built images

The following images have been built and are available on DockerHub.

For more information about these container images, please see the Wiki of this repository.

Image list

image description pulls
r-ver Version-stable base R & src build tools Docker Pulls
rstudio Adds rstudio server Docker Pulls
tidyverse Adds tidyverse & devtools Docker Pulls
verse Adds tex & publishing-related packages Docker Pulls
geospatial Adds geospatial packages on top of 'verse' Docker Pulls
shiny Adds shiny server on top of 'r-ver' Docker Pulls
shiny-verse Adds tidyverse packages on top of 'shiny' Docker Pulls
binder Adds requirements to 'geospatial' to run repositories on mybinder.org Docker Pulls
cuda Adds cuda and Python to 'r-ver' (a.k.a rocker/r-ver:X.Y.Z-cuda10.1) Docker Pulls
ml Adds rstudio server, tidyverse, devtools to 'cuda' Docker Pulls
ml-verse Adds tex & publishing-related packages & geospatial packages to 'ml' Docker Pulls

Tags

Check the Wiki for the list of tags.

There are also special tags that are not listed, devel and latest-daily. We build images daily with the devel tag, which installs the development version of R, and the latest-daily tag, which installs the RStudio daily build.

  • The devel tag is available for rocker/r-ver, rocker/rstudio, rocker/tidyverse, rocker/verse.
  • The latest-daily tag is available for rocker/rstudio, rocker/tidyverse, rocker/verse.

Modifying and extending images

Check the website for common methods for Rocker images. https://www.rocker-project.org/use/extending/

Install R packages

Please install R packages from source using the install.packages() R function or the install2.r script, and use apt only to install necessary system libraries (e.g. libxml2). Do not use apt install r-cran-* to install R packages.

If you would prefer to install only the latest verions of packages from pre-built binaries using apt, consider using r-base or rocker/r-bspm instead.

Rocker scripts

The Docker images built from this repository describe the software installation method in standalone scripts rather than directly in the Dockerfiles. These files are under the scripts directory, and these files are copied in all Docker images, under a top-level /rocker_scripts directory. This allows users to extend images by selecting additional modules to install on top of any pre-built images.

For instance, if one wishes to install Shiny Server on top of a base of rocker/rstudio:4.0.0, one could write a simple Dockerfile as follows:

FROM rocker/rstudio:4.0.0
RUN /rocker_scripts/install_shiny_server.sh

Install scripts can generally take a version as a first argument or ingest an environment variable to specify the version to install. So to install fixed versions, one can use either of the following syntaxes:

FROM rocker/rstudio:4.0.0
ENV SHINY_SERVER_VERSION 1.5.14.948
RUN /rocker_scripts/install_shiny_server.sh
FROM rocker/rstudio:4.0.0
RUN /rocker_scripts/install_shiny_server.sh 1.5.14.948

RStudio Server and Shiny Server are managed by the S6 supervisor system, which allows containers to manage multiple background processes gracefully.

Note: No longer support ADD= runtime triggers for installing Shiny or similar modules, which is used for R <= 3.6.3 images.

Build system

Container definition files

Dockerfiles and docker-bake.json files, which define the pre-built images, are in the dockerfiles folder and the bakefiles folder. And, these files are created from the JSON files under the stacks folder by the build scripts under the build folder.

When a new version of R or RStudio is released, GitHub Actions will automatically create a Pull Request to update these files.

Update pre-built images

Latest R version images will be built on a rolling basis; when the definition files or Rocker scripts are updated, they are immediately built by GitHub Actions.

Non-latest R version images will be built when a new R version is released. At this time, a tag and a GitHub release will also be created.

Contributing

Please check https://github.com/rocker-org/rocker/wiki/How-to-contribute.

License

The Dockerfiles and the scripts in this repository are licensed under the GPL 2 or later.