-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathDockerfile_fs7
More file actions
322 lines (320 loc) · 13 KB
/
Copy pathDockerfile_fs7
File metadata and controls
322 lines (320 loc) · 13 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
# Generated by Neurodocker and Reproenv.
FROM ubuntu:jammy
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 \
&& 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
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
bc \
curl \
libglu1-mesa \
libgomp1 \
libsm-dev \
libx11-dev \
libxext-dev \
libxt-dev \
perl-modules \
tar \
tcsh \
wget \
&& rm -rf /var/lib/apt/lists/*
ENV OS="Linux" \
PATH="/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH" \
FREESURFER_HOME="/opt/freesurfer" \
FREESURFER="/opt/freesurfer" \
SUBJECTS_DIR="/opt/freesurfer/subjects" \
LOCAL_DIR="/opt/freesurfer/local" \
FSFAST_HOME="/opt/freesurfer/fsfast" \
FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" \
FUNCTIONALS_DIR="/opt/freesurfer/sessions" \
FS_OVERRIDE="0" \
FIX_VERTEX_AREA="" \
FSF_OUTPUT_FORMAT="nii.gz" \
MINC_BIN_DIR="/opt/freesurfer/mni/bin" \
MINC_LIB_DIR="/opt/freesurfer/mni/lib" \
MNI_DIR="/opt/freesurfer/mni" \
MNI_DATAPATH="/opt/freesurfer/mni/data" \
MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5" \
PERL5LIB="/opt/freesurfer/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/freesurfer \
&& 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/freesurfer --owner root --group root --no-same-owner --transform='s,freesurfer/,,' \
--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'
RUN if [ ! -z `which node` ] ; then \
echo "node is installed, skipping its install." ; \
else \
apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
apt-utils \
ca-certificates \
curl \
gnupg \
&& rm -rf /var/lib/apt/lists/* \
&& curl -SLO https://deb.nodesource.com/nsolid_setup_deb.sh \
&& chmod 500 nsolid_setup_deb.sh \
&& ./nsolid_setup_deb.sh 20 \
&& apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
nodejs \
&& rm -rf /var/lib/apt/lists/* ; \
fi \
&& node --version \
&& npm --version \
&& npm install -g bids-validator@1.12.0
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/python/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 ["python3", "/run.py"]
# Save specification to JSON.
RUN printf '{ \
"pkg_manager": "apt", \
"existing_users": [ \
"root" \
], \
"instructions": [ \
{ \
"name": "from_", \
"kwds": { \
"base_image": "ubuntu:jammy" \
} \
}, \
{ \
"name": "env", \
"kwds": { \
"LANG": "en_US.UTF-8", \
"LC_ALL": "en_US.UTF-8", \
"ND_ENTRYPOINT": "/neurodocker/startup.sh" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "export ND_ENTRYPOINT=\\"/neurodocker/startup.sh\\"\\napt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n apt-utils \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl \\\\\\n locales \\\\\\n unzip\\nrm -rf /var/lib/apt/lists/*\\nsed -i -e '"'"'s/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/'"'"' /etc/locale.gen\\ndpkg-reconfigure --frontend=noninteractive locales\\nupdate-locale LANG=\\"en_US.UTF-8\\"\\nchmod 777 /opt && chmod a+s /opt\\nmkdir -p /neurodocker\\nif [ ! -f \\"$ND_ENTRYPOINT\\" ]; then\\n echo '"'"'#!/usr/bin/env bash'"'"' >> \\"$ND_ENTRYPOINT\\"\\n echo '"'"'set -e'"'"' >> \\"$ND_ENTRYPOINT\\"\\n echo '"'"'export USER=\\"${USER:=`whoami`}\\"'"'"' >> \\"$ND_ENTRYPOINT\\"\\n echo '"'"'if [ -n \\"$1\\" ]; then \\"$@\\"; else /usr/bin/env bash; fi'"'"' >> \\"$ND_ENTRYPOINT\\";\\nfi\\nchmod -R 777 /neurodocker && chmod a+s /neurodocker" \
} \
}, \
{ \
"name": "install", \
"kwds": { \
"pkgs": [ \
"tcsh", \
"bc", \
"tar", \
"libgomp1", \
"perl-modules", \
"wget", \
"curl", \
"libsm-dev", \
"libx11-dev", \
"libxt-dev", \
"libxext-dev", \
"libglu1-mesa" \
], \
"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 libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n tar \\\\\\n tcsh \\\\\\n wget \\\\\\n && rm -rf /var/lib/apt/lists/*" \
} \
}, \
{ \
"name": "env", \
"kwds": { \
"OS": "Linux", \
"PATH": "/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH", \
"FREESURFER_HOME": "/opt/freesurfer", \
"FREESURFER": "/opt/freesurfer", \
"SUBJECTS_DIR": "/opt/freesurfer/subjects", \
"LOCAL_DIR": "/opt/freesurfer/local", \
"FSFAST_HOME": "/opt/freesurfer/fsfast", \
"FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \
"FUNCTIONALS_DIR": "/opt/freesurfer/sessions", \
"FS_OVERRIDE": "0", \
"FIX_VERTEX_AREA": "", \
"FSF_OUTPUT_FORMAT": "nii.gz", \
"MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \
"MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \
"MNI_DIR": "/opt/freesurfer/mni", \
"MNI_DATAPATH": "/opt/freesurfer/mni/data", \
"MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5", \
"PERL5LIB": "/opt/freesurfer/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/freesurfer\\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/freesurfer --owner root --group root --no-same-owner --transform='"'"'s,freesurfer/,,'"'"' \\\\\\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": "run", \
"kwds": { \
"command": "if [ ! -z `which node` ] ; then \\\\\\n echo \\"node is installed, skipping its install.\\" ; \\\\\\nelse \\\\\\n apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n apt-utils \\\\\\n ca-certificates \\\\\\n curl \\\\\\n gnupg\\nrm -rf /var/lib/apt/lists/*\\n curl -SLO https://deb.nodesource.com/nsolid_setup_deb.sh\\n chmod 500 nsolid_setup_deb.sh\\n ./nsolid_setup_deb.sh 20\\n apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n nodejs\\nrm -rf /var/lib/apt/lists/* ; \\\\\\n fi\\nnode --version\\nnpm --version\\nnpm install -g bids-validator@1.12.0" \
} \
}, \
{ \
"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/python/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": [ \
"python3", \
"/run.py" \
] \
} \
} \
] \
}' > /.reproenv.json
# End saving to specification to JSON.