-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (44 loc) · 2.15 KB
/
Copy pathDockerfile
File metadata and controls
56 lines (44 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM ubuntu:resolute
ENV CRAN="https://cloud.r-project.org/bin/linux/ubuntu resolute-cran40/"
#ENV CRAN="https://ppa.launchpadcontent.net/cran/r-4.6/ubuntu resolute main"
ENV VIENNA="https://statmath.wu.ac.at/AASC/debian testing main non-free"
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
# Use a reliable Ubuntu mirror
RUN sed -i /etc/apt/sources.list.d/ubuntu.sources \
-e 's|archive\.ubuntu\.com|mirror.nl.leaseweb.net|g' \
-e 's|security\.ubuntu\.com|mirror.nl.leaseweb.net|g' \
-e 's|ports\.ubuntu\.com|mirror.nl.leaseweb.net|g'
# hack for broken lam4-dev
RUN mkdir -p /usr/share/man/man3 && \
touch /usr/share/man/man3/MPI_Comm_set_name_lam4-dev.3.gz
# install r-base and rcheckserver
RUN apt -yq update &&\
apt -yq dist-upgrade &&\
apt -yq install apt-transport-https ca-certificates curl
RUN echo "deb [trusted=yes arch=amd64] ${VIENNA}" > /etc/apt/sources.list.d/vienna.list && \
echo "deb [trusted=yes] ${CRAN}" > /etc/apt/sources.list.d/cran.list && \
curl -sSL https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc -o /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc && \
apt -yq update &&\
apt -yq install language-pack-en-base cloc curl parallel vim wget r-base-dev &&\
apt -yq install rcheckserver &&\
apt clean
# Default cargo on Ubuntu LTS is often too old
# Maybe we can disable this after updating to Ubuntu 26.04
#RUN apt -yq install cargo-1.89 &&\
# update-alternatives --force --install /usr/bin/rust rust /usr/lib/rust-1.89 100 --slave /usr/bin/rustc rustc /usr/bin/rustc-1.89 &&\
# update-alternatives --force --install /usr/bin/cargo cargo /usr/bin/cargo-1.89 100
COPY Renviron /etc/R/Renviron.site
COPY Rprofile /etc/R/Rprofile.site
# For outdated r-recommended packages
RUN R -e "stopifnot(getRversion() >= '4.6'); update.packages(ask=FALSE)"
## Set a default user. Available via runtime flag
## Add user to 'staff' group, granting them write privileges to
## /usr/local/lib/R/site.library
## User should also have & own a home directory
RUN useradd docker \
&& mkdir /home/docker \
&& chown docker:docker /home/docker \
&& usermod -a -G staff docker
CMD ["R"]