简体   繁体   中英

How to install in a docker container an old version of a r package

How can I install ggplot2 2.2.1 within a docker container?

The command lines

RUN R -e "install.packages('devtools', repos='http://cran.rstudio.com/')"
RUN R -e "devtools::install_github('http://github.com/tidyverse/ggplot2/archive/v2.2.1.tar.gz')"

in the Dockerfile gives me the error:

The command '/bin/sh -c R -r "devtools::install_github('https://github.com/tidyverse/ggplot2/archive/v2.2.1.tar.gz')"' returned a non-zero code: 2

If I remove the line

RUN R -e "devtools::install_github('http://github.com/tidyverse/ggplot2

no error appears. I also tried different approaches to install ggplot2 2.2.1 but all led to the same result/error.

I solved the problem by changing the command

RUN R -e "install.packages('devtools', repos='http://cran.rstudio.com/', dependencies = TRUE)"

Now devtools is installed appropriate.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM