forked from ReproNim/neurodocker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerated-full.Dockerfile
More file actions
457 lines (423 loc) · 15.3 KB
/
Copy pathgenerated-full.Dockerfile
File metadata and controls
457 lines (423 loc) · 15.3 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
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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
# Generated by Neurodocker v0.2.0-45-ge7522f3.
#
# 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
#
# Timestamp: 2017-09-08 18:40:18
FROM debian:stretch
ARG DEBIAN_FRONTEND=noninteractive
#----------------------------------------------------------
# Install common dependencies and create default entrypoint
#----------------------------------------------------------
ENV LANG="en_US.UTF-8" \
LC_ALL="C.UTF-8" \
ND_ENTRYPOINT="/neurodocker/startup.sh"
RUN apt-get update -qq && apt-get install -yq --no-install-recommends \
bzip2 ca-certificates curl locales unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& localedef --force --inputfile=en_US --charmap=UTF-8 C.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 +x' >> $ND_ENTRYPOINT \
&& echo 'if [ -z "$*" ]; then /usr/bin/env bash; else $*; fi' >> $ND_ENTRYPOINT; \
fi \
&& chmod -R 777 /neurodocker && chmod a+s /neurodocker
ENTRYPOINT ["/neurodocker/startup.sh"]
ARG FOO="BAR" \
BAZ
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends git \
vim \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
#--------------------
# Install AFNI latest
#--------------------
ENV PATH=/opt/afni:$PATH
RUN apt-get update -qq && apt-get install -yq --no-install-recommends ed gsl-bin libglu1-mesa-dev libglib2.0-0 libglw1-mesa \
libgomp1 libjpeg62 libxm4 netpbm tcsh xfonts-base xvfb \
&& libs_path=/usr/lib/x86_64-linux-gnu \
&& if [ -f $libs_path/libgsl.so.19 ]; then \
ln $libs_path/libgsl.so.19 $libs_path/libgsl.so.0; \
fi \
# Install libxp (not in all ubuntu/debian repositories) \
&& apt-get install -yq --no-install-recommends libxp6 \
|| /bin/bash -c " \
curl --retry 5 -o /tmp/libxp6.deb -sSL http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb \
&& dpkg -i /tmp/libxp6.deb && rm -f /tmp/libxp6.deb" \
# Install libpng12 (not in all ubuntu/debian repositories) \
&& apt-get install -yq --no-install-recommends libpng12-0 \
|| /bin/bash -c " \
curl -o /tmp/libpng12.deb -sSL http://mirrors.kernel.org/debian/pool/main/libp/libpng/libpng12-0_1.2.49-1%2Bdeb7u2_amd64.deb \
&& dpkg -i /tmp/libpng12.deb && rm -f /tmp/libpng12.deb" \
# Install R \
&& apt-get install -yq --no-install-recommends \
r-base-dev r-cran-rmpi \
|| /bin/bash -c " \
curl -o /tmp/install_R.sh -sSL https://gist.githubusercontent.com/kaczmarj/8e3792ae1af70b03788163c44f453b43/raw/0577c62e4771236adf0191c826a25249eb69a130/R_installer_debian_ubuntu.sh \
&& /bin/bash /tmp/install_R.sh" \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& echo "Downloading AFNI ..." \
&& mkdir -p /opt/afni \
&& curl -sSL --retry 5 https://afni.nimh.nih.gov/pub/dist/tgz/linux_openmp_64.tgz \
| tar zx -C /opt/afni --strip-components=1 \
&& /opt/afni/rPkgsInstall -pkgs ALL \
&& rm -rf /tmp/*
#-------------------
# Install ANTs 2.2.0
#-------------------
RUN echo "Downloading ANTs ..." \
&& curl -sSL --retry 5 https://dl.dropbox.com/s/2f4sui1z6lcgyek/ANTs-Linux-centos5_x86_64-v2.2.0-0740f91.tar.gz \
| tar zx -C /opt
ENV ANTSPATH=/opt/ants \
PATH=/opt/ants:$PATH
#--------------------------
# Install FreeSurfer v6.0.0
#--------------------------
# Install version minimized for recon-all
# See https://github.com/freesurfer/freesurfer/issues/70
RUN apt-get update -qq && apt-get install -yq --no-install-recommends bc libgomp1 libxmu6 libxt6 tcsh perl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& echo "Downloading minimized FreeSurfer ..." \
&& curl -sSL https://dl.dropbox.com/s/nnzcfttc41qvt31/recon-all-freesurfer6-3.min.tgz | tar xz -C /opt \
&& sed -i '$isource $FREESURFER_HOME/SetUpFreeSurfer.sh' $ND_ENTRYPOINT
ENV FREESURFER_HOME=/opt/freesurfer
#-----------------------------------------------------------
# Install FSL v5.0.10
# FSL is non-free. If you are considering commerical use
# of this Docker image, please consult the relevant license:
# https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Licence
#-----------------------------------------------------------
RUN apt-get update -qq && apt-get install -yq --no-install-recommends dc \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& echo "Downloading FSL ..." \
&& curl -sSL https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-5.0.10-centos6_64.tar.gz \
| tar zx -C /opt \
&& /bin/bash /opt/fsl/etc/fslconf/fslpython_install.sh -q -f /opt/fsl \
&& sed -i '$iecho Some packages in this Docker container are non-free' $ND_ENTRYPOINT \
&& sed -i '$iecho If you are considering commercial use of this container, please consult the relevant license:' $ND_ENTRYPOINT \
&& sed -i '$iecho https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Licence' $ND_ENTRYPOINT \
&& sed -i '$isource $FSLDIR/etc/fslconf/fsl.sh' $ND_ENTRYPOINT
ENV FSLDIR=/opt/fsl \
PATH=/opt/fsl/bin:$PATH
#--------------------
# Install MINC 1.9.15
#--------------------
RUN apt-get update -qq && apt-get install -yq --no-install-recommends libgl1-mesa-dev libice6 libsm6 libx11-6 libxext6 libxi6 libxmu6 libgomp1 libjpeg62 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& echo " Downloading MINC, BEASTLIB, and MODELS..." \
&& curl -sSL --retry 5 https://dl.dropbox.com/s/40hjzizaqi91373/minc-toolkit-1.9.15-20170529-CentOS_6.9-x86_64.tar.gz \
| tar zx -C /opt \
&& curl -sSL --retry 5 http://packages.bic.mni.mcgill.ca/tgz/beast-library-1.1.tar.gz \
| tar zx -C /opt/minc/share \
&& curl -sSL --retry 5 -o /tmp/mni_90a.zip http://www.bic.mni.mcgill.ca/~vfonov/icbm/2009/mni_icbm152_nlin_sym_09a_minc2.zip \
&& unzip /tmp/mni_90a.zip -d /opt/minc/share/icbm152_model_09a \
&& curl -sSL --retry 5 -o /tmp/mni_90c.zip http://www.bic.mni.mcgill.ca/~vfonov/icbm/2009/mni_icbm152_nlin_sym_09c_minc2.zip \
&& unzip /tmp/mni_90c.zip -d /opt/minc/share/icbm152_model_09c \
&& rm -r /tmp/mni_90* \
&& sed -i '$isource /opt/minc/minc-toolkit-config.sh' $ND_ENTRYPOINT
# Create new user: neuro
RUN useradd --no-user-group --create-home --shell /bin/bash neuro
USER neuro
#------------------
# Install Miniconda
#------------------
ENV CONDA_DIR=/opt/conda \
PATH=/opt/conda/bin:$PATH
RUN echo "Downloading Miniconda installer ..." \
&& miniconda_installer=/tmp/miniconda.sh \
&& curl -sSL -o $miniconda_installer https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& /bin/bash $miniconda_installer -b -p $CONDA_DIR \
&& rm -f $miniconda_installer \
&& conda config --system --prepend channels conda-forge \
&& conda config --system --set auto_update_conda false \
&& conda config --system --set show_channel_urls true \
&& conda update -y -q --all && sync \
&& conda clean -tipsy && sync
#-------------------------
# Create conda environment
#-------------------------
RUN conda create -y -q --name neuro --channel vida-nyu python=3.5.1 \
numpy \
pandas \
reprozip \
traits \
&& sync && conda clean -tipsy && sync \
&& /bin/bash -c "source activate neuro \
&& pip install -q --no-cache-dir nipype" \
&& sync
ENV PATH=/opt/conda/envs/neuro/bin:$PATH
#-------------------------
# Update conda environment
#-------------------------
RUN /bin/bash -c "source activate neuro \
&& pip install -q --no-cache-dir pylsl" \
&& sync
#-------------------------
# Create conda environment
#-------------------------
RUN conda create -y -q --name py27 python=2.7 \
&& sync && conda clean -tipsy && sync
USER root
#----------------
# Install MRtrix3
#----------------
RUN echo "Downloading MRtrix3 ..." \
&& curl -sSL --retry 5 https://dl.dropbox.com/s/2g008aaaeht3m45/mrtrix3-Linux-centos6.tar.gz \
| tar zx -C /opt
ENV PATH=/opt/mrtrix3/bin:$PATH
#--------------------------------------------------
# Add NeuroDebian repository
# Please note that some packages downloaded through
# NeuroDebian may have restrictive licenses.
#--------------------------------------------------
RUN apt-get update -qq && apt-get install -yq --no-install-recommends dirmngr gnupg \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& curl -sSL http://neuro.debian.net/lists/jessie.us-nh.full \
> /etc/apt/sources.list.d/neurodebian.sources.list \
&& curl -sSL https://dl.dropbox.com/s/zxs209o955q6vkg/neurodebian.gpg \
| apt-key add - \
&& (apt-key adv --refresh-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9 || true) \
&& apt-get update
# Install NeuroDebian packages
RUN apt-get update -qq && apt-get install -yq --no-install-recommends dcm2niix git-annex-standalone \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
#--------------------
# Install PETPVC 1.2.0-b
#--------------------
RUN echo "Downloading PETPVC..." \
&& mkdir /opt/petpvc \
&& curl --retry 5 -sSL https://github.com/UCL/PETPVC/releases/download/v1.2.0-b/PETPVC-1.2.0-b-Linux.tar.gz| tar zx --strip-components=1 -C /opt/petpvc
ENV PATH=/opt/petpvc/bin:$PATH
#----------------------
# Install MCR and SPM12
#----------------------
# Install MATLAB Compiler Runtime
RUN apt-get update -qq && apt-get install -yq --no-install-recommends libxext6 libxt6 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& echo "Downloading MATLAB Compiler Runtime ..." \
&& curl -sSL -o /tmp/mcr.zip https://www.mathworks.com/supportfiles/downloads/R2017a/deployment_files/R2017a/installers/glnxa64/MCR_R2017a_glnxa64_installer.zip \
&& unzip -q /tmp/mcr.zip -d /tmp/mcrtmp \
&& /tmp/mcrtmp/install -destinationFolder /opt/mcr -mode silent -agreeToLicense yes \
&& rm -rf /tmp/*
# Install standalone SPM
RUN echo "Downloading standalone SPM ..." \
&& curl -sSL -o spm.zip http://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/dev/spm12_latest_Linux_R2017a.zip \
&& unzip -q spm.zip -d /opt \
&& chmod -R 777 /opt/spm* \
&& rm -rf spm.zip \
&& /opt/spm12/run_spm12.sh /opt/mcr/v92/ quit \
&& sed -i '$iexport SPMMCRCMD=\"/opt/spm12/run_spm12.sh /opt/mcr/v92/ script\"' $ND_ENTRYPOINT
ENV MATLABCMD=/opt/mcr/v92/toolbox/matlab \
FORCE_SPMMCR=1 \
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/opt/mcr/v92/runtime/glnxa64:/opt/mcr/v92/bin/glnxa64:/opt/mcr/v92/sys/os/glnxa64:$LD_LIBRARY_PATH
USER neuro
ENV KEY_A="VAL_A" \
KEY_B="VAL_B"
ENV KEY_C="based on $KEY_A"
# User-defined instruction
RUN mkdir /opt/mydir
# User-defined BASH instruction
RUN bash -c "echo 'myfile' > /tmp/myfile.txt"
# Add command(s) to entrypoint
RUN sed -i '$iecho hello world' $ND_ENTRYPOINT \
&& sed -i '$isource myfile.sh' $ND_ENTRYPOINT
CMD ["arg1", "arg2"]
VOLUME ["/var", "/tmp"]
EXPOSE 8888 80
LABEL FOO="BAR" \
BAZ="CAT"
WORKDIR /home/neuro
#--------------------------------------
# Save container specifications to JSON
#--------------------------------------
RUN echo '{ \
\n "pkg_manager": "apt", \
\n "check_urls": false, \
\n "instructions": [ \
\n [ \
\n "base", \
\n "debian:stretch" \
\n ], \
\n [ \
\n "arg", \
\n { \
\n "FOO": "BAR", \
\n "BAZ": "" \
\n } \
\n ], \
\n [ \
\n "install", \
\n [ \
\n "git", \
\n "vim" \
\n ] \
\n ], \
\n [ \
\n "afni", \
\n { \
\n "version": "latest" \
\n } \
\n ], \
\n [ \
\n "ants", \
\n { \
\n "version": "2.2.0" \
\n } \
\n ], \
\n [ \
\n "freesurfer", \
\n { \
\n "version": "6.0.0", \
\n "min": true \
\n } \
\n ], \
\n [ \
\n "fsl", \
\n { \
\n "version": "5.0.10" \
\n } \
\n ], \
\n [ \
\n "minc", \
\n { \
\n "version": "1.9.15" \
\n } \
\n ], \
\n [ \
\n "user", \
\n "neuro" \
\n ], \
\n [ \
\n "miniconda", \
\n { \
\n "env_name": "neuro", \
\n "conda_opts": "--channel vida-nyu", \
\n "conda_install": "python=3.5.1 numpy pandas reprozip traits", \
\n "pip_install": "nipype", \
\n "add_to_path": true \
\n } \
\n ], \
\n [ \
\n "miniconda", \
\n { \
\n "env_name": "neuro", \
\n "pip_install": "pylsl" \
\n } \
\n ], \
\n [ \
\n "miniconda", \
\n { \
\n "env_name": "py27", \
\n "conda_install": "python=2.7" \
\n } \
\n ], \
\n [ \
\n "user", \
\n "root" \
\n ], \
\n [ \
\n "mrtrix3", \
\n {} \
\n ], \
\n [ \
\n "neurodebian", \
\n { \
\n "os_codename": "jessie", \
\n "download_server": "usa-nh", \
\n "pkgs": "dcm2niix git-annex-standalone" \
\n } \
\n ], \
\n [ \
\n "petpvc", \
\n { \
\n "version": "1.2.0-b" \
\n } \
\n ], \
\n [ \
\n "spm", \
\n { \
\n "version": "12", \
\n "matlab_version": "R2017a" \
\n } \
\n ], \
\n [ \
\n "user", \
\n "neuro" \
\n ], \
\n [ \
\n "env", \
\n { \
\n "KEY_A": "VAL_A", \
\n "KEY_B": "VAL_B" \
\n } \
\n ], \
\n [ \
\n "env", \
\n { \
\n "KEY_C": "based on $KEY_A" \
\n } \
\n ], \
\n [ \
\n "instruction", \
\n "RUN mkdir /opt/mydir" \
\n ], \
\n [ \
\n "run_bash", \
\n "echo '"'"'myfile'"'"' > /tmp/myfile.txt" \
\n ], \
\n [ \
\n "add_to_entrypoint", \
\n [ \
\n "echo hello world", \
\n "source myfile.sh" \
\n ] \
\n ], \
\n [ \
\n "cmd", \
\n [ \
\n "arg1", \
\n "arg2" \
\n ] \
\n ], \
\n [ \
\n "volume", \
\n [ \
\n "/var", \
\n "/tmp" \
\n ] \
\n ], \
\n [ \
\n "expose", \
\n [ \
\n "8888", \
\n "80" \
\n ] \
\n ], \
\n [ \
\n "label", \
\n { \
\n "FOO": "BAR", \
\n "BAZ": "CAT" \
\n } \
\n ], \
\n [ \
\n "workdir", \
\n "/home/neuro" \
\n ] \
\n ], \
\n "generation_timestamp": "2017-09-08 18:40:18", \
\n "neurodocker_version": "0.2.0-45-ge7522f3" \
\n}' > /neurodocker/neurodocker_specs.json