[英]Add a particular version of R to a docker container
I am trying to install R in an Ubuntu docker image. 我试图在Ubuntu docker镜像中安装R. I am able to successfully do so using this line:
我能够使用这一行成功地做到这一点:
RUN apt-get update && apt-get install -y r-base
but it is installing r 3.2.3. 但它正在安装r 3.2.3。 I need a newer version (3.5.2).
我需要一个更新的版本(3.5.2)。 Does anyone know how to specify which version to download?
有谁知道如何指定下载哪个版本?
Sure thing: 当然可以:
FROM ubuntu:18.10
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get -y install --no-install-recommends --no-install-suggests \
ca-certificates software-properties-common gnupg2 gnupg1 \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 \
&& add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/' \
&& apt-get install r-base
Taken from here: https://cran.r-project.org/bin/linux/ubuntu/README.html 取自此处: https : //cran.r-project.org/bin/linux/ubuntu/README.html
And here: https://github.com/noisebrain/Dockerfiles/blob/0668df74b27f514dab19a7afae6715328de72980/Rstudio-server-aib/rstudio-server-aib.dockerfile 在这里: https : //github.com/noisebrain/Dockerfiles/blob/0668df74b27f514dab19a7afae6715328de72980/Rstudio-server-aib/rstudio-server-aib.dockerfile
root@100d1cda7377:/# R
R version 3.5.2 (2018-12-20) -- "Eggshell Igloo"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.