简体   繁体   English

如何在 docker 容器中安装旧版本的 ar 包

[英]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?如何在 docker 容器中安装 ggplot2 2.2.1?

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:在 Dockerfile 中给了我错误:

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.我还尝试了不同的方法来安装 ggplot2 2.2.1,但都导致了相同的结果/错误。

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.现在 devtools 安装适当。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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