From 269bbf9434d86dee972842aa7357c5deb069016f Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 19 Jun 2024 22:55:20 +1000 Subject: [PATCH 1/3] Fixes to containers FSL dependency - Minified FSL download updated to FSL version 6.0.7.7. - Add ${FSLDIR}/share/fsl/bin to PATH rather than ${FSLDIR}/bin. - Container minification process now appropriately captures eddy_quad command, as well as the softlink selected by its shebang. --- Dockerfile | 23 ++++++++++++++--------- Singularity | 6 +++--- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0a30e90d9f..a0ee81c003 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ ARG MAKE_JOBS="1" ARG DEBIAN_FRONTEND="noninteractive" FROM python:3.8-slim AS base -FROM buildpack-deps:buster AS base-builder +FROM buildpack-deps:bookworm AS base-builder FROM base-builder AS mrtrix3-builder @@ -22,7 +22,8 @@ RUN apt-get -qq update \ libqt5opengl5-dev \ libqt5svg5-dev \ libtiff5-dev \ - qt5-default \ + python3 \ + qtbase5-dev \ zlib1g-dev \ && rm -rf /var/lib/apt/lists/* @@ -30,8 +31,8 @@ RUN apt-get -qq update \ ARG MAKE_JOBS WORKDIR /opt/mrtrix3 RUN git clone -b $MRTRIX3_GIT_COMMITISH --depth 1 https://github.com/MRtrix3/mrtrix3.git . \ - && ./configure $MRTRIX3_CONFIGURE_FLAGS \ - && NUMBER_OF_PROCESSORS=$MAKE_JOBS ./build $MRTRIX3_BUILD_FLAGS \ + && python3 ./configure $MRTRIX3_CONFIGURE_FLAGS \ + && NUMBER_OF_PROCESSORS=$MAKE_JOBS python3 ./build $MRTRIX3_BUILD_FLAGS \ && rm -rf tmp # Download minified ART ACPCdetect (V2.0). @@ -51,10 +52,10 @@ FROM base-builder as freesurfer-installer WORKDIR /opt/freesurfer RUN curl -fsSLO https://raw.githubusercontent.com/freesurfer/freesurfer/v7.1.1/distribution/FreeSurferColorLUT.txt -# Download minified FSL (6.0.4-2) +# Download minified FSL (6.0.7.7) FROM base-builder as fsl-installer WORKDIR /opt/fsl -RUN curl -fsSL https://osf.io/dtep4/download \ +RUN curl -fsSL https://osf.io/ph9ex/download \ | tar xz --strip-components 1 # Build final image. @@ -66,7 +67,8 @@ RUN apt-get -qq update \ binutils \ dc \ less \ - libfftw3-3 \ + libfftw3-single3 \ + libfftw3-double3 \ libgl1-mesa-glx \ libgomp1 \ liblapack3 \ @@ -77,7 +79,8 @@ RUN apt-get -qq update \ libqt5svg5 \ libqt5widgets5 \ libquadmath0 \ - libtiff5 \ + libtiff5-dev \ + python3 \ python3-distutils \ && rm -rf /var/lib/apt/lists/* @@ -96,11 +99,13 @@ ENV ANTSPATH="/opt/ants/bin" \ FSLTCLSH="/opt/fsl/bin/fsltclsh" \ FSLWISH="/opt/fsl/bin/fslwish" \ LD_LIBRARY_PATH="/opt/fsl/lib:$LD_LIBRARY_PATH" \ - PATH="/opt/mrtrix3/bin:/opt/ants/bin:/opt/art/bin:/opt/fsl/bin:$PATH" + PATH="/opt/mrtrix3/bin:/opt/ants/bin:/opt/art/bin:/opt/fsl/share/fsl/bin:$PATH" # Fix "Singularity container cannot load libQt5Core.so.5" on CentOS 7 RUN strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 \ && ldconfig \ && apt-get purge -yq binutils +RUN ln -s /usr/bin/python3 /usr/bin/python + CMD ["/bin/bash"] diff --git a/Singularity b/Singularity index 21904e74fa..36ddb50e9c 100644 --- a/Singularity +++ b/Singularity @@ -27,7 +27,7 @@ Include: apt # All LD_LIBRARY_PATH="/.singularity.d/libs:/usr/lib:/opt/fsl/lib:$LD_LIBRARY_PATH" - PATH="/opt/mrtrix3/bin:/opt/ants/bin:/opt/art/bin:/opt/fsl/bin:$PATH" + PATH="/opt/mrtrix3/bin:/opt/ants/bin:/opt/art/bin:/opt/fsl/share/fsl/bin:$PATH" export LD_LIBRARY_PATH PATH %post @@ -51,8 +51,8 @@ Include: apt mkdir -p /opt/ants && curl -fsSL https://osf.io/yswa4/download | tar xz -C /opt/ants --strip-components 1 # Download FreeSurfer lookup table file (v7.1.1). mkdir -p /opt/freesurfer && curl -fsSL -o /opt/freesurfer/FreeSurferColorLUT.txt https://raw.githubusercontent.com/freesurfer/freesurfer/v7.1.1/distribution/FreeSurferColorLUT.txt - # Download minified FSL (6.0.4-2). - mkdir -p /opt/fsl && curl -fsSL https://osf.io/dtep4/download | tar xz -C /opt/fsl --strip-components 1 + # Download minified FSL (6.0.7.7). + mkdir -p /opt/fsl && curl -fsSL https://osf.io/ph9ex/download | tar xz -C /opt/fsl --strip-components 1 # Use Python3 for anything requesting Python, since Python2 is not installed ln -s /usr/bin/python3 /usr/bin/python From 01a8a9e28fa17d3ccf0b783490206f733be0d592 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 24 Jun 2024 11:51:46 +1000 Subject: [PATCH 2/3] Don't corrupt LD_LIBRARY_PATH with FSL content Should prevent appearance of error: /bin/bash: /opt/fsl/lib/libtinfo.so.6: no version information available (required by /bin/bash) --- Dockerfile | 1 - Singularity | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a0ee81c003..524e94eb7d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -98,7 +98,6 @@ ENV ANTSPATH="/opt/ants/bin" \ FSLMULTIFILEQUIT="TRUE" \ FSLTCLSH="/opt/fsl/bin/fsltclsh" \ FSLWISH="/opt/fsl/bin/fslwish" \ - LD_LIBRARY_PATH="/opt/fsl/lib:$LD_LIBRARY_PATH" \ PATH="/opt/mrtrix3/bin:/opt/ants/bin:/opt/art/bin:/opt/fsl/share/fsl/bin:$PATH" # Fix "Singularity container cannot load libQt5Core.so.5" on CentOS 7 diff --git a/Singularity b/Singularity index 36ddb50e9c..b17eb16b1b 100644 --- a/Singularity +++ b/Singularity @@ -26,7 +26,7 @@ Include: apt export FSLDIR FSLOUTPUTTYPE FSLMULTIFILEQUIT FSLTCLSH FSLWISH # All - LD_LIBRARY_PATH="/.singularity.d/libs:/usr/lib:/opt/fsl/lib:$LD_LIBRARY_PATH" + LD_LIBRARY_PATH="/.singularity.d/libs:/usr/lib:$LD_LIBRARY_PATH" PATH="/opt/mrtrix3/bin:/opt/ants/bin:/opt/art/bin:/opt/fsl/share/fsl/bin:$PATH" export LD_LIBRARY_PATH PATH From 05d7f1ab937c36c8c6ca83fc47aad6fdda04f978 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Sat, 23 Nov 2024 20:04:59 +1100 Subject: [PATCH 3/3] Dockerfile: Fix capitalisation --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 524e94eb7d..b8e693d96b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,24 +36,24 @@ RUN git clone -b $MRTRIX3_GIT_COMMITISH --depth 1 https://github.com/MRtrix3/mrt && rm -rf tmp # Download minified ART ACPCdetect (V2.0). -FROM base-builder as acpcdetect-installer +FROM base-builder AS acpcdetect-installer WORKDIR /opt/art RUN curl -fsSL https://osf.io/73h5s/download \ | tar xz --strip-components 1 # Download minified ANTs (2.3.4-2). -FROM base-builder as ants-installer +FROM base-builder AS ants-installer WORKDIR /opt/ants RUN curl -fsSL https://osf.io/yswa4/download \ | tar xz --strip-components 1 # Download FreeSurfer files. -FROM base-builder as freesurfer-installer +FROM base-builder AS freesurfer-installer WORKDIR /opt/freesurfer RUN curl -fsSLO https://raw.githubusercontent.com/freesurfer/freesurfer/v7.1.1/distribution/FreeSurferColorLUT.txt # Download minified FSL (6.0.7.7) -FROM base-builder as fsl-installer +FROM base-builder AS fsl-installer WORKDIR /opt/fsl RUN curl -fsSL https://osf.io/ph9ex/download \ | tar xz --strip-components 1