-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
executable file
·205 lines (179 loc) · 8.02 KB
/
Dockerfile
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
FROM ubuntu:18.04
ARG DEBIAN_FRONTEND=noninteractive
#----------------------------------------------------------
# Install common dependencies
#----------------------------------------------------------
ENV LANG="en_US.UTF-8" \
LC_ALL="C.UTF-8" \
ND_ENTRYPOINT="/neurodocker/startup.sh"
RUN apt-get update && apt-get install -yq --no-install-recommends \
apt-utils \
build-essential \
bzip2 \
ca-certificates \
curl \
dirmngr\
git \
gnupg2 \
libglib2.0-0 \
libssl1.0.0 \
libssl-dev \
libxcomposite1 \
locales \
m4 \
make \
rsync \
unzip \
wget
RUN wget -O- http://neuro.debian.net/lists/bionic.us-ca.full | tee /etc/apt/sources.list.d/neurodebian.sources.list
# Looks like the same command on both sides of the '||'. Am guessing that sometimes you have to do this a couple of times before it works?
RUN apt-key adv --recv-keys --keyserver pgp.mit.edu 0xA5D32F012649A5A9 || apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xA5D32F012649A5A9
RUN 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
# install connectome workbench
RUN mkdir -p /opt
WORKDIR /opt
RUN curl --retry 5 https://www.humanconnectome.org/storage/app/media/workbench/workbench-linux64-v1.5.0.zip --output workbench-linux64-v1.5.0.zip && \
unzip workbench-linux64-v1.5.0.zip && \
rm workbench-linux64-v1.5.0.zip
#-------------------
# Install ANTs 2.2.0
#-------------------
RUN echo "Downloading ANTs ..." \
&& curl -sSL --retry 5 https://s3.msi.umn.edu/neurodocker-ants-mirror/ANTs-Linux-centos5_x86_64-v2.2.0-0740f91.tar.gz \
| tar zx -C /opt
ENV ANTSPATH=/opt/ants \
PATH=/opt/ants:$PATH
#------------------------
# Install Convert3D 1.0.0
#------------------------
RUN echo "Downloading C3D ..." \
&& mkdir /opt/c3d \
&& curl -sSL --retry 5 https://sourceforge.net/projects/c3d/files/c3d/1.0.0/c3d-1.0.0-Linux-x86_64.tar.gz/download \
| tar -xzC /opt/c3d --strip-components=1
ENV C3DPATH=/opt/c3d/bin \
PATH=/opt/c3d/bin:$PATH
#--------------------------
# Install FreeSurfer v5.3.0-HCP
#--------------------------
RUN apt-get update -qq && apt-get install -yq --no-install-recommends bc libgomp1 libxmu6 libxt6 tcsh \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN echo "Downloading FreeSurfer ..." \
&& curl -sSL --retry 5 https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/5.3.0-HCP/freesurfer-Linux-centos6_x86_64-stable-pub-v5.3.0-HCP.tar.gz \
| tar xz -C /opt \
--exclude='freesurfer/average/mult-comp-cor' \
--exclude='freesurfer/lib/cuda' \
--exclude='freesurfer/lib/qt' \
--exclude='freesurfer/subjects/V1_average' \
--exclude='freesurfer/subjects/bert' \
--exclude='freesurfer/subjects/cvs_avg35' \
--exclude='freesurfer/subjects/cvs_avg35_inMNI152' \
--exclude='freesurfer/subjects/fsaverage3' \
--exclude='freesurfer/subjects/fsaverage4' \
--exclude='freesurfer/subjects/fsaverage5' \
--exclude='freesurfer/subjects/fsaverage6' \
--exclude='freesurfer/subjects/fsaverage_sym' \
--exclude='freesurfer/trctrain' \
&& sed -i '$isource $FREESURFER_HOME/SetUpFreeSurfer.sh' $ND_ENTRYPOINT
ENV FREESURFER_HOME=/opt/freesurfer
# FreeSurfer uses matlab and tries to write the startup.m to the HOME dir.
# Therefore, HOME needs to be a writable dir.
ENV HOME=/opt
#-----------------------------------------------------------
# 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 bc dc libfontconfig1 libfreetype6 libgl1-mesa-dev libglu1-mesa-dev libgomp1 libice6 libxcursor1 libxft2 libxinerama1 libxrandr2 libxrender1 libxt6 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN echo "Downloading FSL ..." \
&& curl -sSL --retry 5 https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-5.0.10-centos6_64.tar.gz \
| tar zx -C /opt \
&& 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 \
FSL_DIR=/opt/fsl \
PATH=/opt/fsl/bin:$PATH
#---------------------
# Install MATLAB Compiler Runtime
#---------------------
RUN mkdir /opt/mcr /opt/mcr_download
WORKDIR /opt/mcr_download
RUN wget https://ssd.mathworks.com/supportfiles/downloads/R2019a/Release/9/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_R2019a_Update_9_glnxa64.zip \
&& unzip MATLAB_Runtime_R2019a_Update_9_glnxa64.zip \
&& ./install -agreeToLicense yes -mode silent -destinationFolder /opt/mcr \
&& rm -rf /opt/mcr_download
#---------------------
# Install MSM Binaries
#---------------------
RUN mkdir /opt/msm
RUN curl -ksSL --retry 5 https://www.doc.ic.ac.uk/~ecr05/MSM_HOCR_v2/MSM_HOCR_v2-download.tgz | tar zx -C /opt
RUN mv /opt/homes/ecr05/MSM_HOCR_v2/* /opt/msm/
RUN rm -rf /opt/homes /opt/msm/MacOSX /opt/msm/Centos
ENV MSMBINDIR=/opt/msm/Ubuntu
#----------------------------
# Make perl version 5.20.3
#----------------------------
RUN curl -sSL --retry 5 http://www.cpan.org/src/5.0/perl-5.20.3.tar.gz | tar zx -C /opt
WORKDIR /opt/perl-5.20.3
RUN ./Configure -des -Dprefix=/usr/local
RUN make && make install
RUN rm -f /usr/bin/perl && ln -s /usr/local/bin/perl /usr/bin/perl
WORKDIR /
RUN rm -rf /opt/perl-5.20.3/
#------------------
# Make libnetcdf
#------------------
RUN curl -sSL --retry 5 https://github.com/Unidata/netcdf-c/archive/v4.6.1.tar.gz | tar zx -C /opt
WORKDIR /opt/netcdf-c-4.6.1/
RUN LDFLAGS=-L/usr/local/lib && CPPFLAGS=-I/usr/local/include && ./configure --disable-netcdf-4 --disable-dap --enable-shared --prefix=/usr/local
RUN make && make install
WORKDIR /usr/local/lib
RUN ln -s libnetcdf.so.13.1.1 libnetcdf.so.6
RUN rm -rf /opt/netcdf-c-4.6.1/
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
#------------------------------------------
# Set Connectome Workbench Binary Directory
#------------------------------------------
RUN ln -s /opt/workbench/bin_linux64/wb_command /opt/workbench/wb_command
RUN mkdir /root/.config /.config
COPY ["brainvis.wustl.edu", "/opt/workbench/brainvis.wustl.edu"]
COPY ["brainvis.wustl.edu", "/root/.config/brainvis.wustl.edu"]
COPY ["brainvis.wustl.edu", "/.config/brainvis.wustl.edu"]
RUN chmod -R 775 /root/.config /.config
ENV WORKBENCHDIR=/opt/workbench \
CARET7DIR=/opt/workbench/bin_linux64 \
CARET7CONFDIR=/opt/workbench/brainvis.wustl.edu
# Fix libz error
RUN ln -s -f /lib/x86_64-linux-gnu/libz.so.1.2.11 /opt/workbench/libs_linux64/libz.so.1
# Fix libstdc++6 error
RUN ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25 /opt/mcr/v96/sys/os/glnxa64/libstdc++.so.6
# # Fix MCR lib errors
# WORKDIR /opt/mcr/v92/bin/glnxa64
# RUN ln -s libicudata.so.56.1 libicudata.so.56
# RUN ln -s libicuuc.so.56.1 libicuuc.so.56
# RUN ln -s libicui18n.so.56.1 libicui18n.so.56
# RUN ln -s libicuio.so.56.1 libicuio.so.56
# RUN ln -s libhdf5_hl.so.8.0.1 libhdf5_hl.so.8
# RUN ln -s libhdf5.so.8.0.1 libhdf5.so.8
# RUN ln -s libCGAL.so.11.0.2 libCGAL.so.11
# RUN ln -s libgmp.so.3.4.1 libgmp.so.3
# RUN ln -s libmpfr.so.1.2.2 libmpfr.so.1
# make this run with Singularity, too.
RUN ldconfig
# setup ENTRYPOINT
CMD ["/bin/bash"]