install2.r just provides a more concise syntax for adding R packages in Dockerfiles, it's available on all rocker images since we use it in the Rocker Dockerfiles too. One can just do:
RUN install2.r -e bookdown rticles rmdshower
to install those packages.
Note that the repo is set by default (rstudio CRAN mirror on :latest, versioned images instead pull from the MRAN snapshots by default to ensure reproducibility).
The -e flag is optional, it makes install.packages() throw an error if the package installation fails (which will cause the docker build command to fail). By default, install.packages() only throws a warning, which means that a Dockerfile can build successfully even if it has failed to install the package.
install2.rjust provides a more concise syntax for adding R packages in Dockerfiles, it's available on all rocker images since we use it in the Rocker Dockerfiles too. One can just do:to install those packages.
Note that the repo is set by default (rstudio CRAN mirror on
:latest, versioned images instead pull from the MRAN snapshots by default to ensure reproducibility).The
-eflag is optional, it makesinstall.packages()throw an error if the package installation fails (which will cause thedocker buildcommand to fail). By default,install.packages()only throws a warning, which means that a Dockerfile can build successfully even if it has failed to install the package.