-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathneuroDockerfile
299 lines (275 loc) · 9.86 KB
/
neuroDockerfile
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# Generated by Neurodocker version 0.5.0
# Timestamp: 2019-07-24 22:09:39 UTC
#
# Thank you for using Neurodocker. If you discover any issues
# or ways to improve this software, please submit an issue or
# pull request on our GitHub repository:
#
# https://github.com/kaczmarj/neurodocker
FROM neurodebian:stretch-non-free
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"
RUN test "$(getent passwd jovyan)" || useradd --no-user-group --create-home --shell /bin/bash jovyan
USER jovyan
ENV CONDA_DIR="/opt/miniconda-latest" \
PATH="/opt/miniconda-latest/bin:$PATH"
RUN export PATH="/opt/miniconda-latest/bin:$PATH" \
&& echo "Downloading Miniconda installer ..." \
&& conda_installer="/tmp/miniconda.sh" \
&& curl -fsSL --retry 5 -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& bash "$conda_installer" -b -p /opt/miniconda-latest \
&& rm -f "$conda_installer" \
&& conda update -yq -nbase conda \
&& conda config --system --prepend channels conda-forge \
&& conda config --system --set auto_update_conda false \
&& conda config --system --set show_channel_urls true \
&& sync && conda clean --all && sync \
&& conda create -y -q --name neuro \
&& conda install -y -q --name neuro \
'python=3.6' \
'pytest' \
'jupyter' \
'jupyterlab' \
'jupyter_contrib_nbextensions' \
'traits' \
'pandas' \
'matplotlib' \
'scikit-learn' \
'scikit-image' \
'seaborn' \
'nbformat' \
'nb_conda' \
&& sync && conda clean --all && sync \
&& bash -c "source activate neuro \
&& pip install --no-cache-dir \
'https://github.com/nipy/nipype/tarball/master' \
'https://github.com/INCF/pybids/tarball/master' \
'nilearn' \
'datalad[full]' \
'nipy' \
'duecredit' \
'nbval'" \
&& rm -rf ~/.cache/pip/* \
&& sync \
&& sed -i '$isource activate neuro' $ND_ENTRYPOINT
RUN bash -c 'source activate neuro && jupyter nbextension enable exercise2/main && jupyter nbextension enable spellchecker/main'
USER root
RUN mkdir /data && chmod 777 /data && chmod a+s /data
RUN mkdir /output && chmod 777 /output && chmod a+s /output
RUN test "$(getent passwd neuro)" || useradd --no-user-group --create-home --shell /bin/bash neuro
USER neuro
RUN bash -c 'source activate neuro \
&& 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/*fingerfootlips*'
RUN curl -L https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/580705089ad5a101f17944a9 -o /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz \
&& tar xf /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz -C /data/ds000114/derivatives/fmriprep/. \
&& rm /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz \
&& find /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c -type f -not -name ?mm_T1.nii.gz -not -name ?mm_brainmask.nii.gz -not -name ?mm_tpm*.nii.gz -delete
COPY [".", "/home/neuro/nipype_tutorial"]
USER root
RUN chown -R neuro /home/neuro/nipype_tutorial
RUN rm -rf /opt/conda/pkgs/*
USER neuro
RUN mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py
WORKDIR /home/neuro/nipype_tutorial
CMD ["jupyter-notebook"]
RUN echo '{ \
\n "pkg_manager": "apt", \
\n "instructions": [ \
\n [ \
\n "base", \
\n "neurodebian:stretch-non-free" \
\n ], \
\n [ \
\n "install", \
\n [ \
\n "ants", \
\n "gcc", \
\n "g++", \
\n "graphviz", \
\n "tree", \
\n "git-annex-standalone", \
\n "vim", \
\n "emacs-nox", \
\n "nano", \
\n "less", \
\n "ncdu", \
\n "tig", \
\n "git-annex-remote-rclone", \
\n "octave", \
\n "netbase" \
\n ] \
\n ], \
\n [ \
\n "freesurfer", \
\n { \
\n "version": "6.0.0-min" \
\n } \
\n ], \
\n [ \
\n "user", \
\n "jovyan" \
\n ], \
\n [ \
\n "miniconda", \
\n { \
\n "conda_install": [ \
\n "python=3.6", \
\n "pytest", \
\n "jupyter", \
\n "jupyterlab", \
\n "jupyter_contrib_nbextensions", \
\n "traits", \
\n "pandas", \
\n "matplotlib", \
\n "scikit-learn", \
\n "scikit-image", \
\n "seaborn", \
\n "nbformat", \
\n "nb_conda" \
\n ], \
\n "pip_install": [ \
\n "https://github.com/nipy/nipype/tarball/master", \
\n "https://github.com/INCF/pybids/tarball/master", \
\n "nilearn", \
\n "datalad[full]", \
\n "nipy", \
\n "duecredit", \
\n "nbval" \
\n ], \
\n "create_env": "neuro", \
\n "activate": true \
\n } \
\n ], \
\n [ \
\n "run_bash", \
\n "source activate neuro && jupyter nbextension enable exercise2/main && jupyter nbextension enable spellchecker/main" \
\n ], \
\n [ \
\n "user", \
\n "root" \
\n ], \
\n [ \
\n "run", \
\n "mkdir /data && chmod 777 /data && chmod a+s /data" \
\n ], \
\n [ \
\n "run", \
\n "mkdir /output && chmod 777 /output && chmod a+s /output" \
\n ], \
\n [ \
\n "user", \
\n "neuro" \
\n ], \
\n [ \
\n "run_bash", \
\n "source activate neuro\\n && cd /data\\n && datalad install -r ///workshops/nih-2017/ds000114\\n && cd ds000114\\n && datalad update -r\\n && datalad get -r sub-01/ses-test/anat sub-01/ses-test/func/*fingerfootlips*" \
\n ], \
\n [ \
\n "run", \
\n "curl -L https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/580705089ad5a101f17944a9 -o /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz\\n && tar xf /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz -C /data/ds000114/derivatives/fmriprep/.\\n && rm /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz\\n && find /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c -type f -not -name ?mm_T1.nii.gz -not -name ?mm_brainmask.nii.gz -not -name ?mm_tpm*.nii.gz -delete" \
\n ], \
\n [ \
\n "copy", \
\n [ \
\n ".", \
\n "/home/neuro/nipype_tutorial" \
\n ] \
\n ], \
\n [ \
\n "user", \
\n "root" \
\n ], \
\n [ \
\n "run", \
\n "chown -R neuro /home/neuro/nipype_tutorial" \
\n ], \
\n [ \
\n "run", \
\n "rm -rf /opt/conda/pkgs/*" \
\n ], \
\n [ \
\n "user", \
\n "neuro" \
\n ], \
\n [ \
\n "run", \
\n "mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \\\"0.0.0.0\\\" > ~/.jupyter/jupyter_notebook_config.py" \
\n ], \
\n [ \
\n "workdir", \
\n "/home/neuro/nipype_tutorial" \
\n ], \
\n [ \
\n "cmd", \
\n [ \
\n "jupyter-notebook" \
\n ] \
\n ] \
\n ] \
\n}' > /neurodocker/neurodocker_specs.json