11# Use Ubuntu 16.04 LTS
2- FROM ubuntu:xenial-20200114
2+ FROM ubuntu:xenial-20200706
33
44# Pre-cache neurodebian key
55COPY docker/files/neurodebian.gpg /usr/local/etc/neurodebian.gpg
@@ -16,7 +16,7 @@ RUN apt-get update && \
1616 libtool \
1717 pkg-config \
1818 git && \
19- curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
19+ curl -sSL https://deb.nodesource.com/setup_10.x | bash - && \
2020 apt-get install -y --no-install-recommends \
2121 nodejs && \
2222 apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
@@ -47,6 +47,7 @@ RUN curl -sSL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/frees
4747 --exclude='freesurfer/subjects/V1_average' \
4848 --exclude='freesurfer/trctrain'
4949
50+ # Simulate SetUpFreeSurfer.sh
5051ENV FSL_DIR="/usr/share/fsl/5.0" \
5152 OS="Linux" \
5253 FS_OVERRIDE=0 \
@@ -64,11 +65,10 @@ ENV PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5" \
6465 MNI_PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5" \
6566 PATH="$FREESURFER_HOME/bin:$FSFAST_HOME/bin:$FREESURFER_HOME/tktools:$MINC_BIN_DIR:$PATH"
6667
67- # Installing Neurodebian packages (FSL, AFNI, git)
68+ # Installing Neurodebian packages (FSL, AFNI, git-annex )
6869RUN curl -sSL "http://neuro.debian.net/lists/$( lsb_release -c | cut -f2 ).us-ca.full" >> /etc/apt/sources.list.d/neurodebian.sources.list && \
6970 apt-key add /usr/local/etc/neurodebian.gpg && \
7071 (apt-key adv --refresh-keys --keyserver hkp://ha.pool.sks-keyservers.net 0xA5D32F012649A5A9 || true)
71-
7272RUN apt-get update && \
7373 apt-get install -y --no-install-recommends \
7474 fsl-core=5.0.9-5~nd16.04+1 \
@@ -79,37 +79,34 @@ RUN apt-get update && \
7979 git-annex-standalone && \
8080 apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
8181
82+ # Setting FSL and AFNI envvars
8283ENV FSLDIR="/usr/share/fsl/5.0" \
8384 FSLOUTPUTTYPE="NIFTI_GZ" \
8485 FSLMULTIFILEQUIT="TRUE" \
8586 POSSUMDIR="/usr/share/fsl/5.0" \
86- LD_LIBRARY_PATH="/usr/lib/fsl/5.0:$LD_LIBRARY_PATH" \
8787 FSLTCLSH="/usr/bin/tclsh" \
8888 FSLWISH="/usr/bin/wish" \
8989 AFNI_MODELPATH="/usr/lib/afni/models" \
9090 AFNI_IMSAVE_WARNINGS="NO" \
9191 AFNI_TTATLAS_DATASET="/usr/share/afni/atlases" \
92- AFNI_PLUGINPATH="/usr/lib/afni/plugins"
93- ENV PATH="/usr/lib/fsl/5.0:/usr/lib/afni/bin:$PATH"
92+ AFNI_PLUGINPATH="/usr/lib/afni/plugins" \
93+ PATH="/usr/lib/fsl/5.0:/usr/lib/afni/bin:$PATH" \
94+ LD_LIBRARY_PATH="/usr/lib/fsl/5.0:$LD_LIBRARY_PATH"
9495
9596# Installing ANTs 2.3.4 (NeuroDocker build)
96- ENV ANTSPATH=/usr/lib/ants
97- RUN mkdir -p $ANTSPATH && \
98- curl -sSL "https://dl.dropbox.com/s/gwf51ykkk5bifyj/ants-Linux-centos6_x86_64-v2.3.4.tar.gz" \
97+ ENV ANTSPATH="/usr/lib/ants" \
98+ PATH="/usr/lib/ants:$PATH"
99+ WORKDIR $ANTSPATH
100+ RUN curl -sSL "https://dl.dropbox.com/s/gwf51ykkk5bifyj/ants-Linux-centos6_x86_64-v2.3.4.tar.gz" \
99101 | tar -xzC $ANTSPATH --strip-components 1
100- ENV PATH=$ANTSPATH:$PATH
101-
102- # Installing SVGO
103- RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
104- RUN apt-get install -y nodejs
105- RUN npm install -g svgo
106102
107- # Installing bids-validator
108- RUN npm install -g bids-validator@1.4.0
103+ # Installing SVGO and bids-validator
104+ RUN npm install -g svgo bids-validator@1.5.4 \
105+ && rm -rf ~/.npm ~/.empty
109106
110107# Installing and setting up ICA_AROMA
111- RUN mkdir -p /opt/ICA-AROMA && \
112- curl -sSL "https://github.com/oesteban/ICA-AROMA/archive/v0.4.5.tar.gz" \
108+ WORKDIR /opt/ICA-AROMA
109+ RUN curl -sSL "https://github.com/oesteban/ICA-AROMA/archive/v0.4.5.tar.gz" \
113110 | tar -xzC /opt/ICA-AROMA --strip-components 1 && \
114111 chmod +x /opt/ICA-AROMA/ICA_AROMA.py
115112ENV PATH="/opt/ICA-AROMA:$PATH" \
@@ -122,7 +119,7 @@ RUN curl -sSLO https://repo.continuum.io/miniconda/Miniconda3-4.5.11-Linux-x86_6
122119
123120# Set CPATH for packages relying on compiled libs (e.g. indexed_gzip)
124121ENV PATH="/usr/local/miniconda/bin:$PATH" \
125- CPATH="/usr/local/miniconda/include/ :$CPATH" \
122+ CPATH="/usr/local/miniconda/include:$CPATH" \
126123 LANG="C.UTF-8" \
127124 LC_ALL="C.UTF-8" \
128125 PYTHONNOUSERSITE=1
@@ -144,8 +141,8 @@ RUN conda install -y python=3.7.1 \
144141 zlib; sync && \
145142 chmod -R a+rX /usr/local/miniconda; sync && \
146143 chmod +x /usr/local/miniconda/bin/*; sync && \
147- conda build purge- all; sync && \
148- conda clean -tipsy && sync
144+ conda clean -y -- all && sync && \
145+ rm -rf ~/.conda ~/.cache/pip/*; sync
149146
150147# Unless otherwise specified each process should only use one thread - nipype
151148# will handle parallelization
@@ -163,21 +160,11 @@ RUN python -c "from matplotlib import font_manager" && \
163160
164161# Precaching atlases
165162COPY setup.cfg fmriprep-setup.cfg
163+ COPY scripts/fetch_templates.py fetch_templates.py
164+
166165RUN pip install --no-cache-dir "$( grep templateflow fmriprep-setup.cfg | xargs )" && \
167- python -c "from templateflow import api as tfapi; \
168- tfapi.get('MNI152NLin6Asym', resolution=(1, 2), suffix='T1w', desc=None); \
169- tfapi.get('MNI152NLin6Asym', resolution=(1, 2), desc='brain', suffix='mask'); \
170- tfapi.get('MNI152NLin2009cAsym', resolution=(1, 2), suffix='T1w', desc=None); \
171- tfapi.get('MNI152NLin2009cAsym', resolution=(1, 2), desc='brain', suffix='mask'); \
172- tfapi.get('MNI152NLin2009cAsym', resolution=1, desc='carpet', suffix='dseg'); \
173- tfapi.get('MNI152NLin2009cAsym', resolution=1, label='brain', suffix='probseg'); \
174- tfapi.get('MNI152NLin2009cAsym', resolution=2, desc='fMRIPrep', suffix='boldref'); \
175- tfapi.get('OASIS30ANTs'); \
176- tfapi.get('fsaverage', density='164k', desc='std', suffix='sphere'); \
177- tfapi.get('fsaverage', density='164k', desc='vaavg', suffix='midthickness'); \
178- tfapi.get('fsLR', density='32k'); \
179- tfapi.get('MNI152NLin6Asym', resolution=2, atlas='HCP', suffix='dseg')" && \
180- rm fmriprep-setup.cfg && \
166+ python fetch_templates.py && \
167+ rm fmriprep-setup.cfg fetch_templates.py && \
181168 find $HOME/.cache/templateflow -type d -exec chmod go=u {} + && \
182169 find $HOME/.cache/templateflow -type f -exec chmod go=u {} +
183170
@@ -189,18 +176,14 @@ RUN echo "${VERSION}" > /src/fmriprep/fmriprep/VERSION && \
189176 echo "include fmriprep/VERSION" >> /src/fmriprep/MANIFEST.in && \
190177 pip install --no-cache-dir "/src/fmriprep[all]"
191178
192- RUN install -m 0755 \
193- /src/fmriprep/scripts/generate_reference_mask.py \
194- /usr/local/bin/generate_reference_mask
195-
196179RUN find $HOME -type d -exec chmod go=u {} + && \
197180 find $HOME -type f -exec chmod go=u {} + && \
198181 rm -rf $HOME/.npm $HOME/.conda $HOME/.empty
199182
200183ENV IS_DOCKER_8395080871=1
201184
202185RUN ldconfig
203- WORKDIR /tmp/
186+ WORKDIR /tmp
204187ENTRYPOINT ["/usr/local/miniconda/bin/fmriprep" ]
205188
206189ARG BUILD_DATE
0 commit comments