1

I'm building docker containers with R, with lines like:

RUN Rscript -e 'install.packages("tidyverse", "text2vec")'

However, if there are failures installing one of the packages, even thought there is "...had non-zero exit status" logged, the docker build just carries on.

How can I make Rscript fail with an error code if install.packages had an error installing one of its packages?

Michal Charemza
  • 25,940
  • 14
  • 98
  • 165

1 Answers1

1

Have you seen install2.r and its --error option?

We use it (and wrote it/added that options) for some of the Dockerfiles in the Rocker Project dedicated to Docker support for R.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725