generated from berkeley-dsep-infra/hub-user-image-template
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
122 lines (103 loc) · 3.01 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
FROM rocker/geospatial:4.4.2
# https://github.com/rocker-org/rocker-versioned2/wiki/geospatial_69e6b17dd7e3
ENV NB_USER=rstudio
ENV NB_UID=1000
ENV CONDA_DIR=/srv/conda
# Set ENV for all programs...
ENV PATH=${CONDA_DIR}/bin:$PATH
# Pick up rocker's default TZ
ENV TZ=Etc/UTC
# And set ENV for R! It doesn't read from the environment...
RUN echo "TZ=${TZ}" >> /usr/local/lib/R/etc/Renviron.site
RUN echo "PATH=${PATH}" >> /usr/local/lib/R/etc/Renviron.site
# Add PATH to /etc/profile so it gets picked up by the terminal
RUN echo "PATH=${PATH}" >> /etc/profile
RUN echo "export PATH" >> /etc/profile
ENV HOME=/home/${NB_USER}
WORKDIR ${HOME}
# Install packages needed by notebook-as-pdf
# nodejs for installing notebook / jupyterhub from source
# libarchive-dev for https://github.com/berkeley-dsep-infra/datahub/issues/1997
RUN apt-get update > /dev/null && \
apt-get install --yes \
less \
fonts-symbola \
libx11-xcb1 \
libxtst6 \
libxrandr2 \
libpangocairo-1.0-0 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libgtk-3-0 \
libnss3 \
libnspr4 \
libxss1 \
nodejs \
npm \
texlive-xetex \
texlive-fonts-extra \
texlive-latex-extra \
texlive-fonts-recommended \
texlive-lang-chinese \
texlive-plain-generic \
tini > /dev/null && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN install -d -o ${NB_USER} -g ${NB_USER} ${CONDA_DIR}
USER ${NB_USER}
COPY --chown=1000:1000 install-mambaforge.bash /tmp/install-mambaforge.bash
RUN /tmp/install-mambaforge.bash
RUN rm -f /tmp/install-mambaforge.bash
USER root
RUN rm -rf ${HOME}/.cache
USER ${NB_USER}
COPY --chown=1000:1000 environment.yml /tmp/environment.yml
RUN mamba env update -p ${CONDA_DIR} -f /tmp/environment.yml && \
mamba clean -afy
RUN rm -f /tmp/environment.yml
# DH-327, very similar to what was done for datahub in DH-164
ENV PLAYWRIGHT_BROWSERS_PATH=${CONDA_DIR}
RUN playwright install chromium
# Install IRKernel
RUN R --quiet -e "install.packages('IRkernel', quiet = TRUE)" && \
R --quiet -e "IRkernel::installspec(prefix='${CONDA_DIR}')"
# Install extra R packages
RUN install2.r --error --skipinstalled \
## general interest
anytime \
Hmisc \
lmtest \
lubridate \
latex2exp \
MASS \
patchwork \
stargazer \
tidymodels \
wooldridge \
## machine learning
caret \
parsnip \
torch \
## 241
AER \
randomizr \
## 271
fable \
feasts \
fpp3 \
gamlr \
plm \
lme4 \
Quandl \
quantmod \
tseries \
tsibble \
vcd \
vars \
zoo
# Use simpler locking strategy
COPY file-locks /etc/rstudio/file-locks
# Doing a little cleanup
RUN rm -rf /tmp/downloaded_packages
RUN rm -rf ${HOME}/.cache
ENTRYPOINT ["tini", "--"]