forked from nipreps/niworkflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
126 lines (112 loc) · 5.21 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
# Use Ubuntu 16.04 LTS
FROM ubuntu:xenial-20161213
# Pre-cache neurodebian key
COPY docker/files/neurodebian.gpg /root/.neurodebian.gpg
# Prepare environment
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
bzip2 \
ca-certificates \
xvfb \
cython3 \
build-essential \
autoconf \
libtool \
pkg-config && \
curl -sSL http://neuro.debian.net/lists/xenial.us-ca.full >> /etc/apt/sources.list.d/neurodebian.sources.list && \
apt-key add /root/.neurodebian.gpg && \
(apt-key adv --refresh-keys --keyserver hkp://ha.pool.sks-keyservers.net 0xA5D32F012649A5A9 || true) && \
apt-get update
# Installing freesurfer
RUN curl -sSL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.0/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0.tar.gz | tar zxv -C /opt \
--exclude='freesurfer/trctrain' \
--exclude='freesurfer/subjects/fsaverage_sym' \
--exclude='freesurfer/subjects/fsaverage3' \
--exclude='freesurfer/subjects/fsaverage4' \
--exclude='freesurfer/subjects/cvs_avg35' \
--exclude='freesurfer/subjects/cvs_avg35_inMNI152' \
--exclude='freesurfer/subjects/bert' \
--exclude='freesurfer/subjects/V1_average' \
--exclude='freesurfer/average/mult-comp-cor' \
--exclude='freesurfer/lib/cuda' \
--exclude='freesurfer/lib/qt'
ENV FSL_DIR=/usr/share/fsl/5.0 \
OS=Linux \
FS_OVERRIDE=0 \
FIX_VERTEX_AREA= \
FSF_OUTPUT_FORMAT=nii.gz \
FREESURFER_HOME=/opt/freesurfer
ENV SUBJECTS_DIR=$FREESURFER_HOME/subjects \
FUNCTIONALS_DIR=$FREESURFER_HOME/sessions \
MNI_DIR=$FREESURFER_HOME/mni \
LOCAL_DIR=$FREESURFER_HOME/local \
FSFAST_HOME=$FREESURFER_HOME/fsfast \
MINC_BIN_DIR=$FREESURFER_HOME/mni/bin \
MINC_LIB_DIR=$FREESURFER_HOME/mni/lib \
MNI_DATAPATH=$FREESURFER_HOME/mni/data \
FMRI_ANALYSIS_DIR=$FREESURFER_HOME/fsfast
ENV PERL5LIB=$MINC_LIB_DIR/perl5/5.8.5 \
MNI_PERL5LIB=$MINC_LIB_DIR/perl5/5.8.5 \
PATH=$FREESURFER_HOME/bin:$FSFAST_HOME/bin:$FREESURFER_HOME/tktools:$MINC_BIN_DIR:$PATH
RUN echo "cHJpbnRmICJrcnp5c3p0b2YuZ29yZ29sZXdza2lAZ21haWwuY29tXG41MTcyXG4gKkN2dW12RVYzelRmZ1xuRlM1Si8yYzFhZ2c0RVxuIiA+IC9vcHQvZnJlZXN1cmZlci9saWNlbnNlLnR4dAo=" | base64 -d | sh
# Installing Neurodebian packages (FSL, AFNI, git)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
fsl-core=5.0.9-4~nd16.04+1 \
fsl-mni152-templates=5.0.7-2 \
afni=16.2.07~dfsg.1-5~nd16.04+1
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 \
AFNI_MODELPATH=/usr/lib/afni/models \
AFNI_IMSAVE_WARNINGS=NO \
AFNI_TTATLAS_DATASET=/usr/share/afni/atlases \
AFNI_PLUGINPATH=/usr/lib/afni/plugins
ENV PATH=/usr/lib/fsl/5.0:/usr/lib/afni/bin:$PATH
# Installing ANTs 2.2.0 (NeuroDocker build)
ENV ANTSPATH=/usr/lib/ants
RUN mkdir -p $ANTSPATH && \
curl -sSL "https://dl.dropbox.com/s/2f4sui1z6lcgyek/ANTs-Linux-centos5_x86_64-v2.2.0-0740f91.tar.gz" \
| tar -xzC $ANTSPATH --strip-components 1
ENV PATH=$ANTSPATH:$PATH
# Installing WEBP tools
RUN curl -sSLO "http://downloads.webmproject.org/releases/webp/libwebp-0.5.2-linux-x86-64.tar.gz" && \
tar -xf libwebp-0.5.2-linux-x86-64.tar.gz && cd libwebp-0.5.2-linux-x86-64/bin && \
mv cwebp /usr/local/bin/ && rm -rf libwebp-0.5.2-linux-x86-64
# Installing SVGO
RUN curl -sL https://deb.nodesource.com/setup_7.x | bash -
RUN apt-get install -y nodejs
RUN npm install -g svgo
# Install miniconda
ARG PYTHON_MAJOR=3
RUN curl -sSLO https://repo.continuum.io/miniconda/Miniconda${PYTHON_MAJOR}-4.3.31-Linux-x86_64.sh && \
/bin/bash Miniconda${PYTHON_MAJOR}-4.3.31-Linux-x86_64.sh -b -p /usr/local/miniconda && \
rm Miniconda${PYTHON_MAJOR}-4.3.31-Linux-x86_64.sh
ENV PATH=/usr/local/miniconda/bin:$PATH \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8
# Create conda environment
RUN conda config --add channels conda-forge && \
conda install -y numpy scipy matplotlib pandas lxml libxslt nose mock && \
python -c "from matplotlib import font_manager"
# Installing dev requirements (packages that are not in pypi)
ADD requirements.txt requirements.txt
RUN pip install -r requirements.txt && \
rm -rf ~/.cache/pip
RUN mkdir /niworkflows_data
ENV CRN_SHARED_DATA /niworkflows_data
WORKDIR /root/
COPY . niworkflows/
RUN find /root/niworkflows/ -name "test*.py" -exec chmod a-x '{}' \;
RUN cd niworkflows && \
pip install -e .[all] && \
python -c 'from niworkflows.data.getters import get_mni_icbm152_linear; get_mni_icbm152_linear()' && \
python -c 'from niworkflows.data.getters import get_mni_template_ras; get_mni_template_ras()' && \
python -c 'from niworkflows.data.getters import get_ds003_downsampled; get_ds003_downsampled()' && \
python -c 'from niworkflows.data.getters import get_ants_oasis_template_ras; get_ants_oasis_template_ras()' && \
python -c 'from niworkflows.data.getters import get_mni_icbm152_nlin_asym_09c; get_mni_icbm152_nlin_asym_09c()'