-
Notifications
You must be signed in to change notification settings - Fork 37
/
Dockerfile
207 lines (172 loc) · 6.48 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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
FROM buildpack-deps:focal-scm
ENV TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
ENV NB_USER jovyan
ENV NB_UID 1000
ENV CONDA_DIR /srv/conda
ENV R_LIBS_USER /srv/r
# Explicitly add littler to PATH
# See https://github.com/conda-forge/r-littler-feedstock/issues/6
ENV PATH ${CONDA_DIR}/lib/R/library/littler/bin:${CONDA_DIR}/bin:$PATH
RUN adduser --disabled-password --gecos "Default Jupyter user" ${NB_USER}
# Create user owned R libs dir
# This lets users temporarily install packages
RUN mkdir -p ${R_LIBS_USER} && chown ${NB_USER}:${NB_USER} ${R_LIBS_USER}
# Required for PAUP*
# Note that this doesn't actually install python2, thankfully
RUN apt-get update -qq --yes > /dev/null && \
apt-get install --yes -qq \
libpython2.7 > /dev/null
## libraries required for mothur
## libreadline6 required
#RUN apt-get update -qq --yes > /dev/null && \
# apt-get install --yes -qq \
# libreadline6-dev > /dev/null
## library required for fast-PCA & https://github.com/DReichLab/EIG
RUN apt-get update -qq --yes && \
apt-get install --yes --no-install-recommends -qq \
libgsl-dev >/dev/null
## library required for running ccb293 package qiime
#RUN apt-get update -qq --yes > /dev/null && \
# apt-get install --yes -qq \
# tzdata > /dev/null
# Install these without 'recommended' packages to keep image smaller.
# Useful utils that folks sort of take for granted
RUN apt-get update -qq --yes && \
apt-get install --yes --no-install-recommends -qq \
less \
htop \
man \
nano \
screen \
tar \
tmux \
wget \
vim \
tini \
locales > /dev/null
RUN echo "${LC_ALL} UTF-8" > /etc/locale.gen && \
locale-gen
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
RUN echo "deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/" > /etc/apt/sources.list.d/cran.list
# Install R packages
# Our pre-built R packages from rspm are built against system libs in focal
# rstan takes forever to compile from source, and needs libnodejs
# So we install older (10.x) nodejs from apt rather than newer from conda
ENV R_VERSION=4.1.2-1.2004.0
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
RUN echo "deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/" > /etc/apt/sources.list.d/cran.list
RUN apt-get update -qq --yes > /dev/null && \
apt-get install --yes -qq \
r-base-core=${R_VERSION} \
r-base-dev=${R_VERSION} \
r-cran-littler=0.3.14-1.2004.0 \
libglpk-dev \
libzmq5 \
nodejs npm > /dev/null
# Install desktop packages
RUN apt-get update -qq --yes > /dev/null && \
apt-get install --yes -qq \
dbus-x11 \
firefox \
xfce4 \
xfce4-panel \
xfce4-terminal \
xfce4-session \
xfce4-settings \
xorg \
xubuntu-icon-theme > /dev/null
# for nbconvert & notebook-to-pdf
RUN apt-get update -qq --yes && \
apt-get install --yes -qq \
pandoc \
texlive-xetex \
texlive-fonts-recommended \
libx11-xcb1 \
libxtst6 \
libxrandr2 \
libasound2 \
libpangocairo-1.0-0 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libgtk-3-0 \
libnss3 \
libxss1 \
> /dev/null
# Adding ncompress,pbzip2 for issue #1885 BioE-131, Fall 2020
RUN apt-get update -qq --yes > /dev/null && \
apt-get install --yes -qq \
ncompress \
pbzip2 > /dev/null
WORKDIR /home/jovyan
# Needed by RStudio
RUN apt-get update -qq --yes && \
apt-get install --yes --no-install-recommends -qq \
psmisc \
sudo \
libapparmor1 \
lsb-release \
libclang-dev \
libpq5 > /dev/null
ENV RSTUDIO_URL https://download2.rstudio.org/server/bionic/amd64/rstudio-server-2021.09.1-372-amd64.deb
RUN curl --silent --location --fail ${RSTUDIO_URL} > /tmp/rstudio.deb && \
dpkg -i /tmp/rstudio.deb && \
rm /tmp/rstudio.deb
# Needed by many R libraries
# Picked up from https://github.com/rocker-org/rocker/blob/9dc3e458d4e92a8f41ccd75687cd7e316e657cc0/r-rspm/focal/Dockerfile
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libgdal26 \
libgeos-3.8.0 \
libproj15 \
libudunits2-0 \
libxml2 > /dev/null
# R_LIBS_USER is set by default in /etc/R/Renviron, which RStudio loads.
# We uncomment the default, and set what we wanna - so it picks up
# the packages we install. Without this, RStudio doesn't see the packages
# that R does.
# Stolen from https://github.com/jupyterhub/repo2docker/blob/6a07a48b2df48168685bb0f993d2a12bd86e23bf/repo2docker/buildpacks/r.py
RUN sed -i -e '/^R_LIBS_USER=/s/^/#/' /etc/R/Renviron && \
echo "R_LIBS_USER=${R_LIBS_USER}" >> /etc/R/Renviron
# Needed by Rhtslib
RUN apt-get update -qq --yes && \
apt-get install --yes -qq \
libcurl4-openssl-dev > /dev/null
COPY install-mambaforge.bash /tmp/install-mambaforge.bash
RUN chmod 777 /tmp/install-mambaforge.bash
RUN /tmp/install-mambaforge.bash
USER ${NB_USER}
COPY environment.yml /tmp/
COPY infra-requirements.txt /tmp/
RUN mamba env update -p ${CONDA_DIR} -f /tmp/environment.yml && \
mamba clean -afy
# 2024-01-13 sknapp: incompatible due to notebook 7
# RUN jupyter contrib nbextensions install --sys-prefix --symlink && \
# jupyter nbextensions_configurator enable --sys-prefix
# Set CRAN mirror to rspm before we install anything
COPY Rprofile.site /usr/lib/R/etc/Rprofile.site
# RStudio needs its own config
COPY rsession.conf /etc/rstudio/rsession.conf
# Use simpler locking strategy
COPY file-locks /etc/rstudio/file-locks
# Install IRKernel
RUN r -e "install.packages('IRkernel', version='1.2')" && \
r -e "IRkernel::installspec(prefix='${CONDA_DIR}')"
# Install R packages, cleanup temp package download location
COPY install.R /tmp/install.R
RUN r /tmp/install.R && \
rm -rf /tmp/downloaded_packages/ /tmp/*.rds
# install bio1b packages
COPY bio1b-packages.bash /tmp/bio1b-packages.bash
RUN bash /tmp/bio1b-packages.bash
# install ib134L packages
COPY ib134-packages.bash /tmp/ib134-packages.bash
RUN bash /tmp/ib134-packages.bash
# install ccb293 packages
COPY ccb293-packages.bash /tmp/ccb293-packages.bash
RUN bash /tmp/ccb293-packages.bash
ENTRYPOINT ["tini", "--"]