Skip to content

Commit 38cac09

Browse files
authored
MAINT: Dockerfile (#191)
* MAINT: Dockerfile - Update multiarch-support url (AFNI) - Purge version from FSL directory - Use conda env from official nipreps miniconda image
1 parent 6f06472 commit 38cac09

File tree

1 file changed

+32
-43
lines changed

1 file changed

+32
-43
lines changed

Dockerfile

Lines changed: 32 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ WORKDIR $ANTSPATH
4848
RUN curl -sSL "https://dl.dropbox.com/s/gwf51ykkk5bifyj/ants-Linux-centos6_x86_64-v2.3.4.tar.gz" \
4949
| tar -xzC $ANTSPATH --strip-components 1
5050

51-
# AFNI latest (neurodocker build)
51+
# # AFNI latest (neurodocker build)
5252
RUN apt-get update -qq \
5353
&& apt-get install -y -q --no-install-recommends \
5454
ed \
@@ -65,7 +65,7 @@ RUN apt-get update -qq \
6565
xvfb \
6666
&& apt-get clean \
6767
&& rm -rf /var/lib/apt/lists/* \
68-
&& curl -sSL --retry 5 -o /tmp/multiarch.deb http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/multiarch-support_2.27-3ubuntu1.2_amd64.deb \
68+
&& curl -sSL --retry 5 -o /tmp/multiarch.deb http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/multiarch-support_2.27-3ubuntu1.5_amd64.deb \
6969
&& dpkg -i /tmp/multiarch.deb \
7070
&& rm /tmp/multiarch.deb \
7171
&& curl -sSL --retry 5 -o /tmp/libxp6.deb http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb \
@@ -102,6 +102,19 @@ ENV PATH="/opt/afni-latest:$PATH" \
102102
AFNI_IMSAVE_WARNINGS="NO" \
103103
AFNI_PLUGINPATH="/opt/afni-latest"
104104

105+
# Install AFNI latest (neurodocker build)
106+
ENV AFNI_DIR="/opt/afni"
107+
RUN echo "Downloading AFNI ..." \
108+
&& mkdir -p ${AFNI_DIR} \
109+
&& curl -fsSL --retry 5 https://afni.nimh.nih.gov/pub/dist/tgz/linux_openmp_64.tgz \
110+
| tar -xz -C ${AFNI_DIR} --strip-components 1 \
111+
# Keep only what we use
112+
&& find ${AFNI_DIR} -type f -not \( \
113+
-name "3dTshift" -or \
114+
-name "3dUnifize" -or \
115+
-name "3dAutomask" -or \
116+
-name "3dvolreg" \) -delete
117+
105118
# Convert3D (neurodocker build)
106119
RUN echo "Downloading Convert3D ..." \
107120
&& mkdir -p /opt/convert3d-1.0.0 \
@@ -113,7 +126,7 @@ RUN echo "Downloading Convert3D ..." \
113126
ENV C3DPATH="/opt/convert3d-1.0.0" \
114127
PATH="/opt/convert3d-1.0.0/bin:$PATH"
115128

116-
# FSL 5.0.11 (neurodocker build)
129+
# FSL 6.0.5.1
117130
RUN apt-get update -qq \
118131
&& apt-get install -y -q --no-install-recommends \
119132
bc \
@@ -137,9 +150,9 @@ RUN apt-get update -qq \
137150
&& apt-get clean \
138151
&& rm -rf /var/lib/apt/lists/* \
139152
&& echo "Downloading FSL ..." \
140-
&& mkdir -p /opt/fsl-5.0.11 \
141-
&& curl -fsSL --retry 5 https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-5.0.11-centos6_64.tar.gz \
142-
| tar -xz -C /opt/fsl-5.0.11 --strip-components 1 \
153+
&& mkdir -p /opt/fsl \
154+
&& curl -fsSL --retry 5 https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.5.1-centos7_64.tar.gz \
155+
| tar -xz -C /opt/fsl --strip-components 1 \
143156
--exclude "fsl/config" \
144157
--exclude "fsl/data/atlases" \
145158
--exclude "fsl/data/first" \
@@ -160,7 +173,7 @@ RUN apt-get update -qq \
160173
--exclude "fsl/src" \
161174
--exclude "fsl/tcl" \
162175
--exclude "fsl/bin/FSLeyes" \
163-
&& find /opt/fsl-5.0.11/bin -type f -not \( \
176+
&& find /opt/fsl/bin -type f -not \( \
164177
-name "applywarp" -or \
165178
-name "bet" -or \
166179
-name "bet2" -or \
@@ -183,19 +196,16 @@ RUN apt-get update -qq \
183196
-name "susan" -or \
184197
-name "topup" -or \
185198
-name "zeropad" \) -delete \
186-
&& find /opt/fsl-5.0.11/data/standard -type f -not -name "MNI152_T1_2mm_brain.nii.gz" -delete
187-
ENV FSLDIR="/opt/fsl-5.0.11" \
188-
PATH="/opt/fsl-5.0.11/bin:$PATH" \
199+
&& find /opt/fsl/data/standard -type f -not -name "MNI152_T1_2mm_brain.nii.gz" -delete
200+
ENV FSLDIR="/opt/fsl" \
201+
PATH="/opt/fsl/bin:$PATH" \
189202
FSLOUTPUTTYPE="NIFTI_GZ" \
190203
FSLMULTIFILEQUIT="TRUE" \
191-
FSLTCLSH="/opt/fsl-5.0.11/bin/fsltclsh" \
192-
FSLWISH="/opt/fsl-5.0.11/bin/fslwish" \
193204
FSLLOCKDIR="" \
194205
FSLMACHINELIST="" \
195206
FSLREMOTECALL="" \
196207
FSLGECUDAQ="cuda.q" \
197-
POSSUMDIR="/opt/fsl-5.0.11" \
198-
LD_LIBRARY_PATH="/opt/fsl-5.0.11:$LD_LIBRARY_PATH"
208+
LD_LIBRARY_PATH="/opt/fsl/lib:$LD_LIBRARY_PATH"
199209

200210
# Install FreeSurfer
201211
RUN apt update && \
@@ -234,7 +244,7 @@ ENV PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5" \
234244
# remove build-stamp to play nice with nipype
235245

236246
# Installing SVGO and bids-validator
237-
RUN npm install -g svgo@^2.3 bids-validator@^1.8.4 \
247+
RUN npm install -g svgo@^2.3 bids-validator@1.9.0 \
238248
&& rm -rf ~/.npm ~/.empty /root/.npm
239249

240250
# ICA AROMA
@@ -250,42 +260,21 @@ RUN useradd -m -s /bin/bash -G users nibabies
250260
WORKDIR /home/nibabies
251261
ENV HOME="/home/nibabies"
252262

263+
COPY --from=nipreps/miniconda@sha256:ebbff214e6c9dc50ccc6fdbe679df1ffcbceaa45b47a75d6e34e8a064ef178da /opt/conda /opt/conda
264+
253265
# Installing and setting up miniconda
254266
RUN curl -sSLO https://repo.continuum.io/miniconda/Miniconda3-py38_4.9.2-Linux-x86_64.sh && \
255267
bash Miniconda3-py38_4.9.2-Linux-x86_64.sh -b -p /usr/local/miniconda && \
256268
rm Miniconda3-py38_4.9.2-Linux-x86_64.sh
257269

258270
# Set CPATH for packages relying on compiled libs (e.g. indexed_gzip)
259-
ENV PATH="/usr/local/miniconda/bin:$PATH" \
260-
CPATH="/usr/local/miniconda/include:$CPATH" \
271+
ENV PATH="/opt/conda/bin:$PATH" \
272+
CPATH="/opt/conda/include:$CPATH" \
261273
PYTHONNOUSERSITE=1 \
262274
MKL_NUM_THREADS=1 \
263275
OMP_NUM_THREADS=1 \
264276
IS_DOCKER_8395080871=1 \
265-
CONDA_PYTHON="/usr/local/miniconda/bin/python"
266-
267-
# Installing precomputed python packages
268-
RUN conda install -y python=3.8 \
269-
pip=21.0 \
270-
mkl=2021.2 \
271-
mkl-service=2.3 \
272-
numpy=1.20 \
273-
scipy=1.6 \
274-
scikit-image=0.18 \
275-
scikit-learn=0.24 \
276-
matplotlib=3.3 \
277-
pandas=1.2 \
278-
libxslt=1.1 \
279-
traits=6.2 \
280-
zstd=1.4; sync && \
281-
chmod -R a+rX /usr/local/miniconda; sync && \
282-
chmod +x /usr/local/miniconda/bin/*; sync && \
283-
conda clean -y --all && sync && \
284-
rm -rf ~/.conda ~/.cache/pip/*; sync
285-
286-
# Precaching fonts, set 'Agg' as default backend for matplotlib
287-
RUN ${CONDA_PYTHON} -c "from matplotlib import font_manager" && \
288-
sed -i 's/\(backend *: \).*$/\1Agg/g' $( ${CONDA_PYTHON} -c "import matplotlib; print(matplotlib.matplotlib_fname())" )
277+
CONDA_PYTHON="/opt/conda/bin/python"
289278

290279
# Precaching atlases
291280
COPY setup.cfg nibabies-setup.cfg
@@ -303,7 +292,7 @@ RUN echo "${VERSION}" > /src/nibabies/nibabies/VERSION && \
303292
echo "include nibabies/VERSION" >> /src/nibabies/MANIFEST.in && \
304293
${CONDA_PYTHON} -m pip install --no-cache-dir "/src/nibabies[all]"
305294

306-
# ABI tags can interfere when running on Singularity
295+
# ABI tags can interfere when running on Singularity/Apptainer
307296
RUN strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
308297

309298
# Final settings
@@ -320,4 +309,4 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
320309
org.label-schema.version=$VERSION \
321310
org.label-schema.schema-version="1.0"
322311

323-
ENTRYPOINT ["/usr/local/miniconda/bin/nibabies"]
312+
ENTRYPOINT ["/opt/conda/bin/nibabies"]

0 commit comments

Comments
 (0)