【发布时间】:2020-05-26 07:22:56
【问题描述】:
如何在 docker 容器中安装 ggplot2 2.2.1?
命令行
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')"
在 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
如果我删除该行
RUN R -e "devtools::install_github('http://github.com/tidyverse/ggplot2
没有出现错误。我还尝试了不同的方法来安装 ggplot2 2.2.1,但都导致了相同的结果/错误。
【问题讨论】:
-
您是否尝试过使用 docker build -f 显式定义 Dockerfile 位置?这是一个经常被忽视的细节,它会返回您收到的错误。
-
不起作用...同样的错误。没有 RUN R -e "devtools::install_github('github.com/tidyverse/ggplot2/archive/v2.2.1.tar.gz')" 我可以构建图像
-
现在我得出的结论是没有正确安装devtools。显然,在 linux 下需要额外的包,我仍然需要找出来。这些在开头安装:gdebi-core\pandoc\pandoc-citeproc\libcurl4-gnutls-dev\libcairo2-dev\libxt-dev\libssl-dev\libxml2-dev