python-在docker映像中安装R

前端之家收集整理的这篇文章主要介绍了python-在docker映像中安装R 前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

如何在docker映像中安装R版本3.4.0.我已经使用以下命令安装了python

  1. RUN yum -y install https://centos6.iuscommunity.org/ius-release.rpm \
  2. && yum -y install python36u \
  3. && yum -y install python36u-devel \
  4. && yum -y install python36u-pip \
  5. && yum -y install python36u-tkinter.x86_64

同样,我需要安装R:

到目前为止,我已经在文件中为R指定了以下内容

  1. ENV R_BASE_VERSION 3.4.0
  2. RUN Rscript -e 'install.packages("devtools",dependencies=TRUE)' \
  3. &&Rscript -e 'install.packages("methods",dependencies=TRUE)' \
  4. &&Rscript -e 'install.packages("jsonlite",dependencies=TRUE)' \

请建议.我是Docker的新手

我认为我需要执行以下操作:

  1. ENV R_BASE_VERSION 3.4.1
  2. ## Now install R and littler,and create a link for littler in /usr/local/bin
  3. ## Also set a default CRAN repo,and make sure littler knows about it too
  4. RUN apt-get update \
  5. && apt-get install -t unstable -y --no-install-recommends \
  6. littler \
  7. r-cran-littler \
  8. r-base=${R_BASE_VERSION}* \
  9. r-base-dev=${R_BASE_VERSION}* \
  10. r-recommended=${R_BASE_VERSION}* \
  11. && echo 'options(repos = c(CRAN = "https://cran.rstudio.com/"),download.file.method = "libcurl")' >> /etc/R/Rprofile.site \
  12. && echo 'source("/etc/R/Rprofile.site")' >> /etc/littler.r \
  13. && ln -s /usr/share/doc/littler/examples/install.r /usr/local/bin/install.r \
  14. && ln -s /usr/share/doc/littler/examples/install2.r /usr/local/bin/install2.r \
  15. && ln -s /usr/share/doc/littler/examples/installGithub.r /usr/local/bin/installGithub.r \
  16. && ln -s /usr/share/doc/littler/examples/testInstalled.r /usr/local/bin/testInstalled.r \
  17. && install.r docopt \
  18. && rm -rf /tmp/downloaded_packages/ /tmp/*.rds \
  19. && rm -rf /var/lib/apt/lists/*

但是我不知道这是什么垃圾.我只需要安装R,然后按照上面的说明安装所需的软件包.

编辑:我的docker文件中的第一行安装了node4.

最佳答案
这是两个安装Python的DockerFile,R和NodeJS

第一个安装Python 3.4.2,R 3.1.1和nodejs 4.8.4:

  1. From node:4
  2. RUN apt-get update && apt-get remove -y python && apt-get install -y python3 r-base
  3. RUN cp /usr/bin/python3 /usr/bin/python

第二个安装了Python 3.5.3,R 3.4.1和nodejs 4.8.4:

  1. From r-base:3.4.1
  2. RUN apt-get update && apt-get install -y python3 nodejs
  3. RUN cp /usr/bin/python3 /usr/bin/python

选择最适合您的需求.

猜你在找的Docker相关文章