Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
192 lines (168 loc) · 7.08 KB
/
Copy pathDockerfile
File metadata and controls
192 lines (168 loc) · 7.08 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
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
FROM jupyter/datascience-notebook:7a3e968dd212
# Neurodebian:
USER root
# https://bugs.debian.org/830696 (apt uses gpgv by default in newer releases, rather than gpg)
RUN set -x \
&& apt-get update \
&& { \
which gpg \
|| apt-get install -y --no-install-recommends gnupg \
; } \
# Ubuntu includes "gnupg" (not "gnupg2", but still 2.x), but not dirmngr, and gnupg 2.x requires dirmngr
# so, if we're not running gnupg 1.x, explicitly install dirmngr too
&& { \
gpg --version | grep -q '^gpg (GnuPG) 1\.' \
|| apt-get install -y --no-install-recommends dirmngr \
; } \
&& rm -rf /var/lib/apt/lists/*
# apt-key is a bit finicky during "docker build" with gnupg 2.x, so install the repo key the same way debian-archive-keyring does (/etc/apt/trusted.gpg.d)
# this makes "apt-key list" output prettier too!
RUN set -x \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys DD95CC430502E37EF840ACEEA5D32F012649A5A9 \
&& gpg --batch --export DD95CC430502E37EF840ACEEA5D32F012649A5A9 > /etc/apt/trusted.gpg.d/neurodebian.gpg \
&& rm -rf "$GNUPGHOME" \
&& apt-key list | grep neurodebian
RUN { \
echo 'deb http://neuro.debian.net/debian trusty main'; \
echo 'deb http://neuro.debian.net/debian data main'; \
echo '#deb-src http://neuro.debian.net/debian-devel trusty main'; \
} > /etc/apt/sources.list.d/neurodebian.sources.list
# Minimalistic package to assist with freezing the APT configuration
# which would be coming from neurodebian repo.
# Also install and enable eatmydata to be used for all apt-get calls
# to speed up docker builds.
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends neurodebian-freeze eatmydata \
&& ln -s /usr/bin/eatmydata /usr/local/bin/apt-get \
&& rm -rf /var/lib/apt/lists/*
# Neurodocker:
ARG DEBIAN_FRONTEND="noninteractive"
ENV LANG="en_US.UTF-8" \
LC_ALL="en_US.UTF-8" \
ND_ENTRYPOINT="/neurodocker/startup.sh"
RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \
&& apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
apt-utils \
bzip2 \
ca-certificates \
curl \
locales \
unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \
&& update-locale LANG="en_US.UTF-8" \
&& chmod 777 /opt && chmod a+s /opt \
&& mkdir -p /neurodocker \
&& if [ ! -f "$ND_ENTRYPOINT" ]; then \
echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT" \
&& echo 'set -e' >> "$ND_ENTRYPOINT" \
&& echo 'export USER="${USER:=`whoami`}"' >> "$ND_ENTRYPOINT" \
&& echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT"; \
fi \
&& chmod -R 777 /neurodocker && chmod a+s /neurodocker
ENTRYPOINT ["/neurodocker/startup.sh"]
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
ants \
gcc \
g++ \
graphviz \
tree \
git-annex-standalone \
vim \
emacs-nox \
nano \
less \
ncdu \
tig \
git-annex-remote-rclone \
octave \
netbase \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV FREESURFER_HOME="/opt/freesurfer-6.0.0-min" \
PATH="/opt/freesurfer-6.0.0-min/bin:$PATH"
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
bc \
libgomp1 \
libxmu6 \
libxt6 \
perl \
tcsh \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& echo "Downloading FreeSurfer ..." \
&& mkdir -p /opt/freesurfer-6.0.0-min \
&& curl -fsSL --retry 5 https://dl.dropbox.com/s/nnzcfttc41qvt31/recon-all-freesurfer6-3.min.tgz \
| tar -xz -C /opt/freesurfer-6.0.0-min --strip-components 1 \
&& sed -i '$isource "/opt/freesurfer-6.0.0-min/SetUpFreeSurfer.sh"' "$ND_ENTRYPOINT"
### End neurodocker
RUN mkdir /data && chown jovyan /data && chmod 777 /data && mkdir /output && chown jovyan /output && chmod 777 /output && mkdir /repos && chown jovyan /repos && chmod 777 /repos
USER jovyan
RUN pip install --no-cache-dir \
https://github.com/nipy/nipype/tarball/master \
https://github.com/INCF/pybids/tarball/master \
https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master \
https://github.com/nipype/pydra/tarball/master \
https://github.com/noahbenson/popeye/tarball/master \
https://github.com/rflamary/POT/tarball/master \
https://github.com/hichamjanati/mtw/tarball/master \
mne \
s3fs \
pytest \
cookiecutter \
flake8 \
black \
neuropythy \
ipyvolume \
nilearn \
datalad[full] \
nipy \
duecredit \
nbval \
dipy \
tensorflow \
keras \
cloudknot \
nbgitpuller \
psutil\
memory_profiler \
pybids \
neurosynth\
pythreejs \
voila \
jupyter_nbextensions_configurator
# This is for https://github.com/rkern/line_profiler/issues/132
RUN git clone https://github.com/rkern/line_profiler.git && find line_profiler -name '*.pyx' -exec cython {} \; && cd line_profiler && pip install . --user && cd && rm -rf line_profiler
RUN conda update -n base conda && conda install \
python-graphviz
RUN conda install -c conda-forge altair vega_datasets ipyvolume
RUN conda install -c r rpy2 r-ggplot2
RUN cd /data && datalad install -r ///workshops/nih-2017/ds000114 \
&& cd ds000114 \
&& datalad update -r \
&& datalad get -r sub-01/ses-test/anat sub-01/ses-test/func/
RUN jupyter labextension install @jupyterlab/hub-extension
RUN jupyter labextension install ipyvolume
RUN jupyter labextension install jupyter-threejs
RUN jupyter labextension install @lckr/jupyterlab_variableinspector
RUN jupyter labextension install @jupyter-voila/jupyterlab-preview
RUN jupyter contrib nbextension install --user
RUN jupyter nbextension enable exercise2/main
RUN jupyter nbextensions_configurator enable --user
# Begin stuff for Noah's tutorial:
RUN mkdir -p /data/freesurfer_subjects \
&& curl -L -o /data/freesurfer_subjects/fsaverage.tar.gz https://github.com/noahbenson/neuropythy/wiki/files/fsaverage.tar.gz \
&& curl -L -o /data/freesurfer_subjects/fsaverage_sym.tar.gz https://github.com/noahbenson/neuropythy/wiki/files/fsaverage_sym.tar.gz \
&& cd /data/freesurfer_subjects && tar zxf fsaverage.tar.gz && tar zxf fsaverage_sym.tar.gz && rm ./fsaverage.tar.gz ./fsaverage_sym.tar.gz
# Get the npythyrc file:
RUN curl -L -o "$HOME/.npythyrc" https://raw.githubusercontent.com/noahbenson/neuropythy/master/docker/npythyrc
# Make a directory for the HCP data and neuropythy's cache
RUN mkdir -p /data/hcp/subjects /data/cache
# End of stuff for Noah's tutorial