forked from Macatools/macapype
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_macapype_env
209 lines (191 loc) · 7.76 KB
/
Dockerfile_macapype_env
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
# Generated by: Neurodocker version 0.7.0+15.ga4940e3.dirty
# Latest release: Neurodocker version 0.7.0
#
# 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/ReproNim/neurodocker
#
# Timestamp: 2020/12/02 18:33:44 UTC
FROM debian:buster
USER root
ARG DEBIAN_FRONTEND="noninteractive"
MAINTAINER David Meunier "[email protected]"
RUN apt-get update -qq
################################################## Neurodocker
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 install -y -q --no-install-recommends \
apt-utils \
bzip2 \
ca-certificates \
curl \
locales \
unzip \
&& 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 echo '{ \
\n "pkg_manager": "apt", \
\n "instructions": [ \
\n [ \
\n "base", \
\n "debian:buster" \
\n ], \
\n [ \
\n "ants", \
\n { \
\n "version": "2.3.1" \
\n } \
\n ], \
\n [ \
\n "fsl", \
\n { \
\n "version": "5.0.10" \
\n } \
\n ], \
\n [ \
\n "afni", \
\n { \
\n "version": "latest" \
\n } \
\n ]\
\n ] \
\n}' > /neurodocker/neurodocker_specs.json
################################################## Install FSL
ENV FSLDIR="/opt/fsl-5.0.10" \
PATH="/opt/fsl-5.0.10/bin:$PATH" \
FSLOUTPUTTYPE="NIFTI_GZ" \
FSLMULTIFILEQUIT="TRUE" \
FSLTCLSH="/opt/fsl-5.0.10/bin/fsltclsh" \
FSLWISH="/opt/fsl-5.0.10/bin/fslwish" \
FSLLOCKDIR="" \
FSLMACHINELIST="" \
FSLREMOTECALL="" \
FSLGECUDAQ="cuda.q"
RUN apt-get install -y -q --no-install-recommends \
bc \
dc \
file \
libfontconfig1 \
libfreetype6 \
libgl1-mesa-dev \
libgl1-mesa-dri \
libglu1-mesa-dev \
libgomp1 \
libice6 \
libxcursor1 \
libxft2 \
libxinerama1 \
libxrandr2 \
libxrender1 \
libxt6 \
sudo \
wget \
&& echo "Downloading FSL ..." \
&& mkdir -p /opt/fsl-5.0.10 \
&& curl -fsSL --retry 5 https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-5.0.10-centos6_64.tar.gz \
| tar -xz -C /opt/fsl-5.0.10 --strip-components 1 \
&& 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 \
&& echo "Installing FSL conda environment ..." \
&& bash /opt/fsl-5.0.10/etc/fslconf/fslpython_install.sh -f /opt/fsl-5.0.10
################################################## Install AFNI
ENV PATH="/opt/afni-latest:$PATH" \
AFNI_PLUGINPATH="/opt/afni-latest"
RUN apt-get install -y -q --no-install-recommends \
ed \
gsl-bin \
libglib2.0-0 \
libglu1-mesa-dev \
libglw1-mesa \
libgomp1 \
libjpeg62 \
libxm4 \
multiarch-support \
netpbm \
tcsh \
xfonts-base \
xvfb \
&& curl -sSL --retry 5 -o /tmp/toinstall.deb http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb \
&& dpkg -i /tmp/toinstall.deb \
&& rm /tmp/toinstall.deb \
&& curl -sSL --retry 5 -o /tmp/toinstall.deb http://snapshot.debian.org/archive/debian-security/20160113T213056Z/pool/updates/main/libp/libpng/libpng12-0_1.2.49-1%2Bdeb7u2_amd64.deb \
&& dpkg -i /tmp/toinstall.deb \
&& rm /tmp/toinstall.deb \
&& apt-get install -f \
&& gsl2_path="$(find / -name 'libgsl.so.23' || printf '')" \
&& if [ -n "$gsl2_path" ]; then \
ln -sfv "$gsl2_path" "$(dirname $gsl2_path)/libgsl.so.0"; \
fi \
&& ldconfig \
&& echo "Downloading AFNI ..." \
&& mkdir -p /opt/afni-latest \
&& curl -fsSL --retry 5 https://afni.nimh.nih.gov/pub/dist/tgz/linux_openmp_64.tgz \
| tar -xz -C /opt/afni-latest --strip-components 1
################################################## Install ANTS
ENV ANTSPATH="/opt/ants-2.3.1" \
PATH="/opt/ants-2.3.1:$PATH"
RUN echo "Downloading ANTs ..." \
&& mkdir -p /opt/ants-2.3.1 \
&& curl -fsSL --retry 5 https://dl.dropbox.com/s/1xfhydsf4t4qoxg/ants-Linux-centos6_x86_64-v2.3.1.tar.gz \
| tar -xz -C /opt/ants-2.3.1 --strip-components 1
################################################## Install SPM12 as MCR
RUN apt-get -y install unzip xorg wget
# Install MATLAB MCR in /opt/mcr/
ENV MATLAB_VERSION R2019b
ENV MCR_VERSION v97
RUN mkdir /opt/mcr_install \
&& mkdir /opt/mcr \
&& wget --progress=bar:force -P /opt/mcr_install https://ssd.mathworks.com/supportfiles/downloads/${MATLAB_VERSION}/Release/3/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_${MATLAB_VERSION}_Update_3_glnxa64.zip \
&& unzip -q /opt/mcr_install/MATLAB_Runtime_${MATLAB_VERSION}_Update_3_glnxa64.zip -d /opt/mcr_install \
&& /opt/mcr_install/install -destinationFolder /opt/mcr -agreeToLicense yes -mode silent \
&& rm -rf /opt/mcr_install /tmp/*
# Install SPM Standalone in /opt/spm12/
ENV SPM_VERSION 12
ENV SPM_REVISION r7771
ENV LD_LIBRARY_PATH /opt/mcr/${MCR_VERSION}/runtime/glnxa64:/opt/mcr/${MCR_VERSION}/bin/glnxa64:/opt/mcr/${MCR_VERSION}/sys/os/glnxa64:/opt/mcr/${MCR_VERSION}/sys/opengl/lib/glnxa64:/opt/mcr/${MCR_VERSION}/extern/bin/glnxa64
ENV MCR_INHIBIT_CTF_LOCK 1
ENV SPM_HTML_BROWSER 0
# Running SPM once with "function exit" tests the succesfull installation *and*
# extracts the ctf archive which is necessary if singularity is going to be
# used later on, because singularity containers are read-only.
# Also, set +x on the entrypoint for non-root container invocations
RUN wget --no-check-certificate --progress=bar:force -P /opt https://www.fil.ion.ucl.ac.uk/spm/download/restricted/bids/spm${SPM_VERSION}_${SPM_REVISION}_Linux_${MATLAB_VERSION}.zip \
&& unzip -q /opt/spm${SPM_VERSION}_${SPM_REVISION}_Linux_${MATLAB_VERSION}.zip -d /opt \
&& rm -f /opt/spm${SPM_VERSION}_${SPM_REVISION}_Linux_${MATLAB_VERSION}.zip \
&& /opt/spm${SPM_VERSION}/spm${SPM_VERSION} function exit \
&& chmod +x /opt/spm${SPM_VERSION}/spm${SPM_VERSION}
ENV SPM_DIR /opt/spm${SPM_VERSION}
######################## NiftiReg
RUN apt-get install --yes --no-install-recommends \
ca-certificates cmake gcc g++ git make \
&& git clone https://github.com/KCL-BMEIS/niftyreg.git /tmp/niftyreg-src \
&& mkdir /tmp/niftyreg-build \
&& cd /tmp/niftyreg-build \
&& cmake -DCMAKE_INSTALL_PREFIX=/opt/niftyreg /tmp/niftyreg-src \
&& make \
&& make install
ENV PATH=/opt/niftyreg/bin:$PATH
################################################## Finishing
RUN apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN rm -rf \
/tmp/hsperfdata* \
/var/*/apt/*/partial \
/var/log/apt/term*