-
Notifications
You must be signed in to change notification settings - Fork 35
/
Dockerfile_fs7
343 lines (341 loc) · 13.5 KB
/
Dockerfile_fs7
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
# Generated by Neurodocker and Reproenv.
FROM ubuntu:jammy
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
bc \
curl \
libglu1-mesa \
libgomp1 \
libpython2.7-stdlib \
libsm-dev \
libx11-dev \
libxext-dev \
libxt-dev \
perl-modules \
python2 \
tar \
tcsh \
wget \
&& rm -rf /var/lib/apt/lists/*
ENV OS="Linux" \
PATH="/opt//bin:/opt//fsfast/bin:/opt//tktools:/opt//mni/bin:$PATH" \
FREESURFER_HOME="/opt/" \
FREESURFER="/opt/" \
SUBJECTS_DIR="/opt//subjects" \
LOCAL_DIR="/opt//local" \
FSFAST_HOME="/opt//fsfast" \
FMRI_ANALYSIS_DIR="/opt//fsfast" \
FUNCTIONALS_DIR="/opt//sessions" \
FS_OVERRIDE="0" \
FIX_VERTEX_AREA="" \
FSF_OUTPUT_FORMAT="nii.gz# mni env requirements" \
MINC_BIN_DIR="/opt//mni/bin" \
MINC_LIB_DIR="/opt//mni/lib" \
MNI_DIR="/opt//mni" \
MNI_DATAPATH="/opt//mni/data" \
MNI_PERL5LIB="/opt//mni/share/perl5" \
PERL5LIB="/opt//mni/share/perl5"
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
bc \
ca-certificates \
curl \
libgomp1 \
libxmu6 \
libxt6 \
perl \
tcsh \
&& rm -rf /var/lib/apt/lists/* \
&& echo "Downloading FreeSurfer ..." \
&& mkdir -p /opt/ \
&& curl -fL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer-linux-centos7_x86_64-7.4.1.tar.gz \
| tar -xz -C /opt/ --owner root --group root --no-same-owner --strip-components 1 \
--exclude='average/mult-comp-cor' \
--exclude='lib/cuda' \
--exclude='lib/qt' \
--exclude='subjects/V1_average' \
--exclude='subjects/bert' \
--exclude='subjects/cvs_avg35' \
--exclude='subjects/cvs_avg35_inMNI152' \
--exclude='subjects/fsaverage3' \
--exclude='subjects/fsaverage4' \
--exclude='subjects/fsaverage5' \
--exclude='subjects/fsaverage6' \
--exclude='subjects/fsaverage_sym' \
--exclude='trctrain'
ENV CONDA_DIR="/opt/miniconda-latest" \
PATH="/opt/miniconda-latest/bin:$PATH"
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
bzip2 \
ca-certificates \
curl \
&& rm -rf /var/lib/apt/lists/* \
# Install dependencies.
&& export PATH="/opt/miniconda-latest/bin:$PATH" \
&& echo "Downloading Miniconda installer ..." \
&& conda_installer="/tmp/miniconda.sh" \
&& curl -fsSL -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 install -yq -nbase conda-libmamba-solver \
&& conda config --set solver libmamba \
# Prefer packages in conda-forge
&& conda config --system --prepend channels conda-forge \
# Packages in lower-priority channels not considered if a package with the same
# name exists in a higher priority channel. Can dramatically speed up installations.
# Conda recommends this as a default
# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html
&& conda config --set channel_priority strict \
&& conda config --system --set auto_update_conda false \
&& conda config --system --set show_channel_urls true \
# Enable `conda activate`
&& conda init bash \
&& conda install -y --name base \
"pandas=1.5.3" \
&& bash -c "source activate base \
&& python -m pip install --no-cache-dir \
"nibabel"" \
# Clean up
&& sync && conda clean --all --yes && sync \
&& rm -rf ~/.cache/pip/*
RUN bash -c 'curl -sL https://deb.nodesource.com/setup_18.x | bash -'
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
nodejs \
&& rm -rf /var/lib/apt/lists/*
RUN bash -c 'npm install -g [email protected]'
ENV FSLDIR="/usr/share/fsl/5.0" \
FSLOUTPUTTYPE="NIFTI_GZ" \
FSLMULTIFILEQUIT="TRUE" \
POSSUMDIR="/usr/share/fsl/5.0" \
LD_LIBRARY_PATH="/usr/lib/fsl/5.0:" \
FSLTCLSH="/usr/bin/tclsh" \
FSLWISH="/usr/bin/wish"
ENV OS="Linux" \
FS_OVERRIDE="0" \
FIX_VERTEX_AREA="" \
SUBJECTS_DIR="/opt/freesurfer/subjects" \
FSF_OUTPUT_FORMAT="nii.gz" \
MNI_DIR="/opt/freesurfer/mni" \
LOCAL_DIR="/opt/freesurfer/local" \
FREESURFER_HOME="/opt/freesurfer" \
FSFAST_HOME="/opt/freesurfer/fsfast" \
MINC_BIN_DIR="/opt/freesurfer/mni/bin" \
MINC_LIB_DIR="/opt/freesurfer/mni/lib" \
MNI_DATAPATH="/opt/freesurfer/mni/data" \
FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" \
PERL5LIB="/opt/freesurfer/mni/share/perl5" \
MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" \
PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
PYTHONPATH=""
RUN mkdir root/matlab && touch root/matlab/startup.m
RUN mkdir /scratch
RUN mkdir /local-scratch
COPY ["run.py", \
"/run.py"]
RUN chmod +x /run.py
COPY ["version", \
"/version"]
ENTRYPOINT ["python", "/run.py"]
# Save specification to JSON.
RUN printf '{ \
"pkg_manager": "apt", \
"existing_users": [ \
"root" \
], \
"instructions": [ \
{ \
"name": "from_", \
"kwds": { \
"base_image": "ubuntu:jammy" \
} \
}, \
{ \
"name": "install", \
"kwds": { \
"pkgs": [ \
"tcsh", \
"bc", \
"tar", \
"libgomp1", \
"perl-modules", \
"wget", \
"curl", \
"libsm-dev", \
"libx11-dev", \
"libxt-dev", \
"libxext-dev", \
"libglu1-mesa", \
"libpython2.7-stdlib", \
"python2" \
], \
"opts": null \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n curl \\\\\\n libglu1-mesa \\\\\\n libgomp1 \\\\\\n libpython2.7-stdlib \\\\\\n libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n python2 \\\\\\n tar \\\\\\n tcsh \\\\\\n wget \\\\\\n && rm -rf /var/lib/apt/lists/*" \
} \
}, \
{ \
"name": "env", \
"kwds": { \
"OS": "Linux", \
"PATH": "/opt//bin:/opt//fsfast/bin:/opt//tktools:/opt//mni/bin:$PATH", \
"FREESURFER_HOME": "/opt/", \
"FREESURFER": "/opt/", \
"SUBJECTS_DIR": "/opt//subjects", \
"LOCAL_DIR": "/opt//local", \
"FSFAST_HOME": "/opt//fsfast", \
"FMRI_ANALYSIS_DIR": "/opt//fsfast", \
"FUNCTIONALS_DIR": "/opt//sessions", \
"FS_OVERRIDE": "0", \
"FIX_VERTEX_AREA": "", \
"FSF_OUTPUT_FORMAT": "nii.gz# mni env requirements", \
"MINC_BIN_DIR": "/opt//mni/bin", \
"MINC_LIB_DIR": "/opt//mni/lib", \
"MNI_DIR": "/opt//mni", \
"MNI_DATAPATH": "/opt//mni/data", \
"MNI_PERL5LIB": "/opt//mni/share/perl5", \
"PERL5LIB": "/opt//mni/share/perl5" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n libgomp1 \\\\\\n libxmu6 \\\\\\n libxt6 \\\\\\n perl \\\\\\n tcsh\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FreeSurfer ...\\"\\nmkdir -p /opt/\\ncurl -fL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer-linux-centos7_x86_64-7.4.1.tar.gz \\\\\\n| tar -xz -C /opt/ --owner root --group root --no-same-owner --strip-components 1 \\\\\\n --exclude='"'"'average/mult-comp-cor'"'"' \\\\\\n --exclude='"'"'lib/cuda'"'"' \\\\\\n --exclude='"'"'lib/qt'"'"' \\\\\\n --exclude='"'"'subjects/V1_average'"'"' \\\\\\n --exclude='"'"'subjects/bert'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35_inMNI152'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage3'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage4'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage5'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage6'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage_sym'"'"' \\\\\\n --exclude='"'"'trctrain'"'"'" \
} \
}, \
{ \
"name": "env", \
"kwds": { \
"CONDA_DIR": "/opt/miniconda-latest", \
"PATH": "/opt/miniconda-latest/bin:$PATH" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\nconda install -yq -nbase conda-libmamba-solver\\nconda config --set solver libmamba\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name base \\\\\\n \\"pandas=1.5.3\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_18.x | bash -'"'"'" \
} \
}, \
{ \
"name": "install", \
"kwds": { \
"pkgs": [ \
"nodejs" \
], \
"opts": null \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n nodejs \\\\\\n && rm -rf /var/lib/apt/lists/*" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "bash -c '"'"'npm install -g [email protected]'"'"'" \
} \
}, \
{ \
"name": "env", \
"kwds": { \
"FSLDIR": "/usr/share/fsl/5.0", \
"FSLOUTPUTTYPE": "NIFTI_GZ", \
"FSLMULTIFILEQUIT": "TRUE", \
"POSSUMDIR": "/usr/share/fsl/5.0", \
"LD_LIBRARY_PATH": "/usr/lib/fsl/5.0:", \
"FSLTCLSH": "/usr/bin/tclsh", \
"FSLWISH": "/usr/bin/wish" \
} \
}, \
{ \
"name": "env", \
"kwds": { \
"OS": "Linux", \
"FS_OVERRIDE": "0", \
"FIX_VERTEX_AREA": "", \
"SUBJECTS_DIR": "/opt/freesurfer/subjects", \
"FSF_OUTPUT_FORMAT": "nii.gz", \
"MNI_DIR": "/opt/freesurfer/mni", \
"LOCAL_DIR": "/opt/freesurfer/local", \
"FREESURFER_HOME": "/opt/freesurfer", \
"FSFAST_HOME": "/opt/freesurfer/fsfast", \
"MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \
"MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \
"MNI_DATAPATH": "/opt/freesurfer/mni/data", \
"FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \
"PERL5LIB": "/opt/freesurfer/mni/share/perl5", \
"MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", \
"PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", \
"PYTHONPATH": "" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "mkdir root/matlab && touch root/matlab/startup.m" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "mkdir /scratch" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "mkdir /local-scratch" \
} \
}, \
{ \
"name": "copy", \
"kwds": { \
"source": [ \
"run.py", \
"/run.py" \
], \
"destination": "/run.py" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "chmod +x /run.py" \
} \
}, \
{ \
"name": "copy", \
"kwds": { \
"source": [ \
"version", \
"/version" \
], \
"destination": "/version" \
} \
}, \
{ \
"name": "entrypoint", \
"kwds": { \
"args": [ \
"python", \
"/run.py" \
] \
} \
} \
] \
}' > /.reproenv.json
# End saving to specification to JSON.