forked from briancheung/C-PAC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
195 lines (170 loc) · 5.37 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
FROM neurodebian:xenial-non-free
MAINTAINER The C-PAC Team <[email protected]>
# create scratch directories for singularity
RUN mkdir /scratch && mkdir /local-scratch && mkdir -p /code && mkdir -p /cpac_resources
# install wget
RUN apt-get update && apt-get install -y wget
# Install the validator
RUN apt-get update && \
apt-get install -y curl && \
curl -sL https://deb.nodesource.com/setup_4.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN npm install -g bids-validator
# Install Ubuntu dependencies
RUN apt-get update && \
apt-get install -y \
build-essential \
cmake \
git \
graphviz \
graphviz-dev \
gsl-bin \
libcanberra-gtk-module \
libexpat1-dev \
libgiftiio-dev \
libglib2.0-dev \
libglu1-mesa \
libglu1-mesa-dev \
libjpeg-progs \
libgl1-mesa-dri \
libglw1-mesa \
libxml2 \
libxml2-dev \
libxext-dev \
libxft2 \
libxft-dev \
libxi-dev \
libxmu-headers \
libxmu-dev \
libxpm-dev \
libxslt1-dev \
m4 \
make \
mesa-common-dev \
mesa-utils \
netpbm \
pkg-config \
tcsh \
unzip \
xvfb \
xauth \
zlib1g-dev
# Install 16.04 dependencies
RUN apt-get update && \
apt-get install -y \
dh-autoreconf \
libgsl-dev \
libmotif-dev \
libtool \
libx11-dev \
libxext-dev \
x11proto-xext-dev \
x11proto-print-dev \
xutils-dev
# Compiles libxp- this is necessary for some newer versions of Ubuntu
# where the is no Debian package available.
RUN git clone git://anongit.freedesktop.org/xorg/lib/libXp /tmp/libXp && \
cd /tmp/libXp && \
./autogen.sh && \
./configure && \
make && \
make install && \
cd / && \
rm -rf /tmp/libXp
# Installing and setting up c3d
RUN mkdir -p /opt/c3d && \
curl -sSL "http://downloads.sourceforge.net/project/c3d/c3d/1.0.0/c3d-1.0.0-Linux-x86_64.tar.gz" \
| tar -xzC /opt/c3d --strip-components 1
ENV C3DPATH /opt/c3d/
ENV PATH $C3DPATH/bin:$PATH
# install AFNI
COPY required_afni_pkgs.txt /opt/required_afni_pkgs.txt
RUN 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 && \
mkdir -p /opt/afni && \
wget -q http://afni.nimh.nih.gov/pub/dist/tgz/linux_openmp_64.tgz && \
tar zxv -C /opt/afni --strip-components=1 -f linux_openmp_64.tgz $(cat /opt/required_afni_pkgs.txt) && \
rm -rf linux_openmp_64.tgz
# set up AFNI
ENV PATH=/opt/afni:$PATH
# install FSL
RUN apt-get update && \
apt-get install -y --no-install-recommends \
fsl-core \
fsl-atlases \
fsl-mni152-templates
# setup FSL environment
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:$LD_LIBRARY_PATH \
FSLTCLSH=/usr/bin/tclsh \
FSLWISH=/usr/bin/wish \
PATH=/usr/lib/fsl/5.0:$PATH
# install CPAC resources into FSL
RUN cd /tmp && \
wget -q http://fcon_1000.projects.nitrc.org/indi/cpac_resources.tar.gz && \
tar xfz cpac_resources.tar.gz && \
cd cpac_image_resources && \
cp -n MNI_3mm/* $FSLDIR/data/standard && \
cp -n MNI_4mm/* $FSLDIR/data/standard && \
cp -n symmetric/* $FSLDIR/data/standard && \
cp -nr tissuepriors/2mm $FSLDIR/data/standard/tissuepriors && \
cp -nr tissuepriors/3mm $FSLDIR/data/standard/tissuepriors && \
cp -n HarvardOxford-lateral-ventricles-thr25-2mm.nii.gz $FSLDIR/data/atlases/HarvardOxford
# install ANTs
RUN apt-get update && \
apt-get install -y ants
# install ICA-AROMA
RUN mkdir -p /opt/ICA-AROMA
RUN curl -SL https://github.com/rhr-pruim/ICA-AROMA/archive/v0.4.3-beta.tar.gz | tar -xzC /opt/ICA-AROMA --strip-components 1
RUN chmod +x /opt/ICA-AROMA/ICA_AROMA.py
ENV PATH=/opt/ICA-AROMA:$PATH
# install miniconda
RUN wget -q http://repo.continuum.io/miniconda/Miniconda-3.8.3-Linux-x86_64.sh && \
bash Miniconda-3.8.3-Linux-x86_64.sh -b -p /usr/local/miniconda && \
rm Miniconda-3.8.3-Linux-x86_64.sh
# update path to include conda
ENV PATH=/usr/local/miniconda/bin:$PATH
# install blas dependency first
RUN conda install -y \
blas
# install conda dependencies
RUN conda install -y \
cython==0.26 \
jinja2==2.7.2 \
matplotlib=2.0.2 \
networkx==1.11 \
nose==1.3.7 \
numpy==1.13.0 \
pandas==0.23.4 \
pyyaml==3.12 \
scipy==0.19.1 \
traits==4.6.0 \
wxpython==3.0.0.0 \
pip
# install python dependencies
COPY requirements.txt /opt/requirements.txt
RUN pip install -r /opt/requirements.txt
RUN pip install xvfbwrapper
# install cpac templates
COPY cpac_templates.tar.gz /cpac_resources/cpac_templates.tar.gz
RUN tar xzvf /cpac_resources/cpac_templates.tar.gz && \
rm -f /cpac_resources/cpac_templates.tar.gz
# clean up
RUN apt-get clean && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# install cpac
COPY . /code
RUN pip install -e /code
# make the run.py executable
RUN chmod +x /code/run.py
# copy useful pipeline scripts
COPY default_pipeline.yaml /cpac_resources/default_pipeline.yaml
COPY test_pipeline.yaml /cpac_resources/test_pipeline.yaml
ENTRYPOINT ["/code/run.py"]