-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDockerfile
174 lines (160 loc) · 5.64 KB
/
Dockerfile
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
FROM edgyr/internal-ubuntu-builder:latest AS builder
FROM ubuntu:bionic
COPY --from=builder /usr/local/lib/rstudio-server /usr/local/lib/rstudio-server
COPY --from=builder /usr/local/bin/pandoc /usr/local/bin/pandoc
COPY --from=builder /usr/local/lib/R /usr/local/lib/R
COPY --from=builder /usr/local/bin/R* /usr/local/bin/
COPY --from=builder /usr/local/lib/libRmath.so /usr/local/lib/libRmath.so
COPY --from=builder /usr/local/lib/libRmath.a /usr/local/lib/libRmath.a
COPY --from=builder /usr/local/include /usr/local/include
ENV S6_VERSION=${S6_VERSION:-v1.21.7.0}
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2
ENV PATH=/usr/local/lib/rstudio-server/bin:$PATH
ENV DEBIAN_FRONTEND=noninteractive
COPY userconf.sh /etc/cont-init.d/userconf
COPY disable_auth_rserver.conf /etc/rstudio/disable_auth_rserver.conf
COPY pam-helper.sh /usr/local/lib/rstudio-server/bin/pam-helper
RUN apt-get update \
&& apt-get install -qqy --no-install-recommends \
cmake \
curl \
default-jdk \
file \
fonts-roboto \
fonts-texgyre \
g++ \
gdal-bin \
gfortran \
ghostscript \
git \
gsfonts \
hugo \
lbzip2 \
less \
libapparmor1 \
libbz2-*\
libbz2-dev \
libclang-dev \
libcurl4 \
libcurl4-openssl-dev \
libedit2 \
libfftw3-dev \
libfribidi-dev \
libgc1c2 \
libgdal-dev \
libgeos-dev \
libgl1-mesa-dev \
libglpk-dev \
libglu1-mesa-dev \
libgmp3-dev \
libgsl0-dev \
libharfbuzz-dev \
libhdf4-alt-dev \
libhdf5-dev \
libhunspell-dev \
libicu-dev \
libjq-dev \
liblzma-dev \
libmagick++-dev \
libnetcdf-dev \
libobjc4 \
libopenmpi-dev \
libpangocairo-* \
libpcre2-dev \
libpng16* \
libpq-dev \
libpq5 \
libproj-dev \
libprotobuf-dev \
libreadline-dev \
libreadline7 \
libsqlite3-dev \
libssl-dev \
libssl-dev \
libudunits2-dev \
libxml2-dev \
libxslt1-dev \
libzmq3-dev \
lsb-release \
netcdf-bin \
postgis \
procps \
protobuf-compiler \
psmisc \
python-setuptools \
qpdf \
software-properties-common \
sqlite3 \
sudo \
texinfo \
texlive-fonts-extra \
texlive-fonts-recommended \
tk-dev \
unixodbc-dev \
wget
RUN mkdir -p /etc/R \
&& mkdir -p /etc/rstudio \
&& mkdir -p /usr/local/lib/R/etc \
&& echo '\n\
\n# Configure httr to perform out-of-band authentication if HTTR_LOCALHOST \
\n# is not set since a redirect to localhost may not work depending upon \
\n# where this Docker container is running. \
\nif(is.na(Sys.getenv("HTTR_LOCALHOST", unset=NA))) { \
\n options(httr_oob_default = TRUE) \
\n}' >> /usr/local/lib/R/etc/Rprofile.site \
&& echo "PATH=${PATH}" >> /usr/local/lib/R/etc/Renviron \
&& useradd rstudio \
&& echo "rstudio:rstudio" | chpasswd \
&& mkdir /home/rstudio \
&& chown rstudio:rstudio /home/rstudio \
&& addgroup rstudio staff \
&& echo 'rsession-which-r=/usr/local/bin/R' >> /etc/rstudio/rserver.conf \
&& echo 'lock-type=advisory' >> /etc/rstudio/file-locks \
&& cd .. \
&& rm -rf src \
&& echo "options(repos = c(CRAN='https://cran.rstudio.com'), download.file.method = 'libcurl')" \
>> /usr/local/lib/R/etc/Rprofile.site \
&& mkdir -p /home/rstudio/.rstudio/monitored/user-settings \
&& echo 'alwaysSaveHistory="0" \
\nloadRData="0" \
\nsaveAction="0"' \
> /home/rstudio/.rstudio/monitored/user-settings/user-settings \
&& chown -R rstudio:rstudio /home/rstudio/.rstudio \
&& mkdir -p /var/run/rstudio-server \
&& mkdir -p /var/lock/rstudio-server \
&& mkdir -p /var/log/rstudio-server \
&& mkdir -p /var/lib/rstudio-server
RUN git config --system credential.helper 'cache --timeout=3600' \
&& git config --system push.default simple \
&& wget -P /tmp/ https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-aarch64.tar.gz \
&& tar xzf /tmp/s6-overlay-aarch64.tar.gz -C / \
&& mkdir -p /etc/services.d/rstudio \
&& echo '#!/usr/bin/with-contenv bash \
\n for line in $( cat /etc/environment ) ; do export $line ; done \
\n exec /usr/local/lib/rstudio-server/bin/rserver --server-daemonize 0' \
> /etc/services.d/rstudio/run \
&& echo '#!/bin/bash \
\n /usr/local/lib/rstudio-server/bin/rstudio-server stop' \
> /etc/services.d/rstudio/finish \
&& cp /usr/local/lib/rstudio-server/extras/init.d/debian/rstudio-server /etc/init.d/ \
&& update-rc.d rstudio-server defaults \
&& ln -f -s /usr/local/lib/rstudio-server/bin/rstudio-server /usr/sbin/rstudio-server \
&& useradd -r rstudio-server
COPY --from=builder /usr/local/src/packages packages
RUN apt-get install -qqy --no-install-recommends libc-ares2 \
&& dpkg -i ./packages/libnghttp2-14_1.36.0-bionic0_arm64.deb \
&& dpkg -i ./packages/libuv1_1.24.1-bionic0_arm64.deb \
&& dpkg -i ./packages/libnode64_10.15.2~dfsg-bionic0_arm64.deb \
&& dpkg -i ./packages/libuv1-dev_1.24.1-bionic0_arm64.deb \
&& dpkg -i ./packages/libnode-dev_10.15.2~dfsg-bionic0_arm64.deb \
&& rm -rf ./packages
RUN echo 'rstudio ALL=(ALL:ALL) ALL' >> /etc/sudoers
RUN wget https://github.com/conda-forge/miniforge/releases/download/4.9.2-5/Mambaforge-Linux-aarch64.sh \
&& sh ./Mambaforge-Linux-aarch64.sh -b -p /usr/local/mambaforge \
&& rm ./Mambaforge-Linux-aarch64.sh
ENV PATH=/usr/local/mambaforge/bin/:$PATH
RUN R CMD javareconf \
&& Rscript -e "install.packages(c('tidyverse', 'sparklyr', \
'rmarkdown', 'shiny', 'rJava', 'reticulate'))"
EXPOSE 8787
CMD ["/init"]