Sign inSign up

rhub/r-minimal

By rhub

Updated about 2 hours ago

Image
7

100K+

rhub/r-minimal repository overview

Minimal Docker images for R

What is R?

R is a free software environment for statistical computing and graphics. It compiles and runs on a wide variety of UNIX platforms, Windows and MacOS. See more at https://www.r-project.org/

Goals and features

The main goal of these images is to keep them minimal, so they can be used as part of a bigger (web) application, or as a base image. Currently the r-minimal image is less than 20MB compressed, and 32MB uncompressed.

All images use Alpine Linux.

The images include the installr tools that can install R packages from CRAN or GitHub.

Limitations

To keep the images minimal, they do not include a number of parts and features that most users would prefer to have for interactive R development:

  • Recommended R packages are not installed.
  • Documentation is not included.
  • No readline library support.
  • No X11 support.
  • No Java support.
  • No OpenMP support.
  • No JPEG, PNG or TIFF support.
  • No Cairo support.
  • No Tcl/Tk support.
  • No translations, only English.
  • The image does not have C, C++ or Fortran compilers.

Dockerfile examples

One of our main goals is to be able to use rhub/r-minimal as a base image, and easily add R packages from CRAN or GitHub to it, to create a new image. Run installr from a Dockerfile to add R packages to the r-minimal image:

FROM rhub/r-minimal
RUN installr praise
CMD [ "R", "--slave", "-e", "cat(praise::praise())" ]

Package with compiled code:

FROM rhub/r-minimal
RUN installr -d glue

After the package(s) have been installed, installr removed the compilers, as these are typically not needed on the final image. If you want to keep them use installr -c instead of installr -d.

Package with system requirements:

FROM rhub/r-minimal
RUN installr -d -t linux-headers pingr
CMD [ "R", "-q", "-e", "pingr::is_online() || stop('offline')" ]

Similarly to compilers, system packages are removed after the R packages have been installed. If you want to keep (some of) them, use installr -a instead of installr -t. (You can also mix the two.)

Hints on installing some popular R packages:

packageinstallr command~ image size
data.tableinstallr -d -t zlib-dev data.table36.9 MB
dplyrinstallr -d dplyr171.9 MB
ggplot2installr -d -t gfortran ggplot2123.4 MB
h2oinstallr -d -a openjdk10-jre -t "curl-dev musl-dev" h2o363.2 MB
knitrinstallr -d knitr73.6 MB
prophetinstallr -d -t "gfortran linux-headers" prophet389.7 MB
shinyinstallr -d -t "file automake autoconf" shiny178.0 MB
rmarkdowninstallr -d rmarkdown196.8 MB (including pandoc)

Note that package and system dependencies change over time, so if any of these commands do not work any more, please let us know.

See the [examples/rmarkdown/Dockerfile] for installing pandoc.

Known failures

License

See https://www.r-project.org/Licenses/ for the R licenses

These Dockerfiles are licensed under the MIT License.

(c) R Consortium

Tag summary

Content type

Image

Digest

sha256:8e23f8fd8

Size

25.3 MB

Last updated

about 2 hours ago

docker pull rhub/r-minimal:2026-09-19