-
Notifications
You must be signed in to change notification settings - Fork 34
/
Dockerfile
190 lines (176 loc) · 4.84 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
FROM us.gcr.io/broad-dsp-gcr-public/terra-jupyter-base:1.1.3
USER root
COPY scripts $JUPYTER_HOME/scripts
# Add env vars to identify binary package installation
ENV TERRA_R_PLATFORM="terra-jupyter-r-2.2.6"
ENV TERRA_R_PLATFORM_BINARY_VERSION=3.20
# Install protobuf 3.20.3. Note this version comes from base deep learning image. Use `conda list` to see what's installed
RUN cd /tmp \
&& wget https://github.com/protocolbuffers/protobuf/releases/download/v3.20.3/protobuf-all-3.20.3.tar.gz \
&& tar -xvzf protobuf-all-3.20.3.tar.gz \
&& cd protobuf-3.20.3/ \
&& ./configure \
&& make \
&& make check \
&& sudo make install \
&& sudo ldconfig \
&& rm -rf /tmp/protobuf-* \
&& cd ~
# Add R kernel
RUN find $JUPYTER_HOME/scripts -name '*.sh' -type f | xargs chmod +x \
&& $JUPYTER_HOME/scripts/kernel/kernelspec.sh $JUPYTER_HOME/scripts/kernel /opt/conda/share/jupyter/kernels
# https://cran.r-project.org/bin/linux/ubuntu/README.html
RUN apt-get update \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 \
&& add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/' \
&& apt-get install -yq --no-install-recommends apt-transport-https \
&& apt update \
&& apt install -yq --no-install-recommends \
apt-utils \
libssh2-1-dev \
libssl-dev \
libcurl4-gnutls-dev \
libgit2-dev \
libxml2-dev \
libgfortran-7-dev \
r-base-dev \
r-base-core \
## This section installs libraries
libnetcdf-dev \
libhdf5-serial-dev \
libfftw3-dev \
libopenbabel-dev \
libopenmpi-dev \
libexempi3 \
libgdal-dev \
libcairo2-dev \
libtiff5-dev \
libgsl0-dev \
libgtk2.0-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libgmp3-dev \
libhdf5-dev \
libncurses-dev \
libxpm-dev \
libv8-3.14-dev \
libgtkmm-2.4-dev \
libmpfr-dev \
libudunits2-dev \
libmodule-build-perl \
libapparmor-dev \
libgeos-dev \
librdf0-dev \
libmagick++-dev \
libsasl2-dev \
libpoppler-cpp-dev \
libpq-dev \
libperl-dev \
libgfortran5 \
## software - perl extentions and modules
libarchive-extract-perl \
libfile-copy-recursive-perl \
libcgi-pm-perl \
libdbi-perl \
libdbd-mysql-perl \
libxml-simple-perl \
## Databases and other software
sqlite \
mpi-default-bin \
openmpi-common \
tcl8.5-dev \
imagemagick \
tabix \
ggobi \
graphviz \
jags \
## Additional resources
xfonts-100dpi \
xfonts-75dpi \
biber \
libzmq3-dev \
libsbml5-dev \
biber \
## for gpuMagic package
ocl-icd-opencl-dev \
## for ChemmineOB package
libeigen3-dev \
## for rawrr package
mono-runtime \
## for nloptr package
cmake \
## for archive package
libarchive-dev \
&& ln -s /usr/lib/gcc/x86_64-linux-gnu/7/libgfortran.so /usr/lib/x86_64-linux-gnu/libgfortran.so \
&& ln -s /usr/lib/gcc/x86_64-linux-gnu/7/libstdc++.so /usr/lib/x86_64-linux-gnu/libstdc++.so \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# DEVEL: Add sys env variables to DEVEL image
# Variables in Renviron.site are made available inside of R.
# Add libsbml CFLAGS
ENV LIBSBML_CFLAGS="-I/usr/include"
ENV LIBSBML_LIBS="-lsbml"
RUN echo 'export LIBSBML_CFLAGS="-I/usr/include"' >> /etc/profile \
&& echo 'export LIBSBML_LIBS="-lsbml"' >> /etc/profile
## set pip3 to run as root, not as jupyter user
ENV PIP_USER=false
## Install python packages needed for a few Bioc packages
RUN pip3 -V \
&& pip3 install --upgrade pip \
&& pip3 install cwltool \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN R -e 'install.packages("BiocManager")' \
## check version
&& R -e "BiocManager::install(version='$TERRA_R_PLATFORM_BINARY_VERSION', ask=FALSE)" \
&& R -e 'BiocManager::install(c( \
"boot", \
"class", \
"cluster", \
"codetools", \
"foreign", \
"kernsmooth", \
"lattice", \
"mass", \
"Matrix", \
"mgcv", \
"nlme", \
"nnet", \
"rpart", \
"Seurat", \
"spatial", \
"survival", \
# Jupyter notebook essentials
"IRdisplay", \
"IRkernel", \
# GCP essentials
"bigrquery", \
"googleCloudStorageR", \
# User oriented packages
"reticulate", \
"remotes", \
"devtools", \
"tidyverse", \
"pbdZMQ", \
"uuid"))' \
&& R -e 'BiocManager::install("DataBiosphere/Ronaldo")'
# Install Bioconductor packages found at:
# https://raw.githubusercontent.com/anvilproject/anvil-docker/master/anvil-rstudio-bioconductor/install.R
RUN R -e 'BiocManager::install(c( \
"AnVIL", \
"SingleCellExperiment", \
"GenomicFeatures", \
"GenomicAlignments", \
"ShortRead", \
"DESeq2", \
"AnnotationHub", \
"ExperimentHub", \
"ensembldb", \
"scRNAseq", \
"scran", \
"Rtsne"))'
## pip runs as jupyter user
ENV PIP_USER=true
RUN R -e 'IRkernel::installspec(user=FALSE)' \
&& chown -R $USER:users /usr/local/lib/R/site-library /home/jupyter
USER $USER