在Deepnote的Dockerfile中安装一个R包



我在Deepnote中用R内核建立了一个自定义环境,我想用Dockerfile来安装mosaic包(否则我每天都要手动安装,需要一段时间(。当我添加时

RUN R -e 'install.packages("mosaic")'

在Dockerfile中的IRkernel::installspec行之后,我得到以下输出:

Step #1: > install.packages("mosaic")
Step #1: Installing package into ‘/usr/local/lib/R/site-library’
Step #1: (as ‘lib’ is unspecified)
Step #1: Warning in install.packages("mosaic") :
Step #1:   'lib = "/usr/local/lib/R/site-library"' is not writable
Step #1: Error in install.packages("mosaic") : unable to install packages
Step #1: Execution halted
Step #1: The command '/bin/sh -c R -e 'install.packages("mosaic")'' returned a non-zero code: 1
Finished Step #1
ERROR
ERROR: build step 1 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1
Step #1: 

我做错了什么?

链接到的示例有一个sudo:

RUN sudo apt-get update && 
sudo apt-get install -y r-base
RUN sudo R -e "install.packages('IRkernel', repos='http://cran.rstudio.com/')"
^^^^

您可能也需要它,因为您收到了is not writable消息。

相关内容

  • 没有找到相关文章

最新更新