Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to fix EddyQC in minified container #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 23 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG MAKE_JOBS="1"
ARG DEBIAN_FRONTEND="noninteractive"

FROM debian:buster as base
FROM buildpack-deps:buster AS base-builder
FROM debian:bookworm as base
FROM buildpack-deps:bookworm AS base-builder

FROM base-builder as mrtrix3-builder

Expand All @@ -19,22 +19,23 @@ RUN apt-get -qq update \
libfftw3-dev \
libpng-dev \
libtiff5-dev \
python3 \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*

# Clone, build, and install MRtrix3.
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 testing/ tmp/

# Install ART ACPCdetect.
from base-builder as acpcdetect-builder
WORKDIR /opt/art
COPY acpcdetect_v2.0_LinuxCentOS6.7.tar.gz /opt/art/acpcdetect_v2.0_LinuxCentOS6.7.tar.gz
RUN tar -xf acpcdetect_v2.0_LinuxCentOS6.7.tar.gz
COPY acpcdetect_V2.1_LinuxCentOS6.7.tar.gz /opt/art/acpcdetect_V2.1_LinuxCentOS6.7.tar.gz
RUN tar -xf acpcdetect_V2.1_LinuxCentOS6.7.tar.gz

# Compile and install ANTs.
FROM base-builder as ants-builder
Expand All @@ -45,7 +46,7 @@ RUN apt-get -qq update \
&& rm -rf /var/lib/apt/lists/*
ARG MAKE_JOBS
WORKDIR /src/ants
RUN curl -fsSL https://github.com/ANTsX/ANTs/archive/v2.3.4.tar.gz \
RUN curl -fsSL https://github.com/ANTsX/ANTs/archive/v2.5.2.tar.gz \
| tar xz --strip-components 1 \
&& mkdir build \
&& cd build \
Expand All @@ -57,7 +58,7 @@ RUN curl -fsSL https://github.com/ANTsX/ANTs/archive/v2.3.4.tar.gz \
-DCMAKE_INSTALL_PREFIX:PATH=/opt/ants \
-DRUN_LONG_TESTS:BOOL=OFF \
-DRUN_SHORT_TESTS:BOOL=OFF \
--target=N4BiasFieldCorrection \
# --target=N4BiasFieldCorrection \
.. \
&& make -j $MAKE_JOBS \
&& cd ANTS-build \
Expand All @@ -72,10 +73,6 @@ RUN curl -fsSLO https://raw.githubusercontent.com/freesurfer/freesurfer/v7.1.1/d
# Install FSL.
FROM base-builder AS fsl-installer
WORKDIR /opt/fsl
COPY FSL_source.txt source.txt
RUN curl -fL -# --retry 5 https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.4-centos6_64.tar.gz \
| tar -xz --strip-components 1
# Install fslpython in a separate layer to preserve the cache of the (long) download.
RUN apt-get -qq update \
&& apt-get install -yq --no-install-recommends \
bc \
Expand All @@ -88,17 +85,22 @@ RUN apt-get -qq update \
libglu1-mesa-dev \
libgomp1 \
libice6 \
libopenblas-base \
libopenblas0 \
libxcursor1 \
libxft2 \
libxinerama1 \
libxrandr2 \
libxrender1 \
libxt6 \
python3 \
sudo \
wget \
&& rm -rf /var/lib/apt/lists/* \
&& bash /opt/fsl/etc/fslconf/fslpython_install.sh -f /opt/fsl
&& rm -rf /var/lib/apt/lists/*
RUN wget https://fsl.fmrib.ox.ac.uk/fsldownloads/fslinstaller.py \
&& python3 fslinstaller.py -V 6.0.7.7 -d /opt/fsl -m -o
# Have to run this after the installation script;
# it wipes all pre-existing contents of the directory
COPY FSL_source.txt source.txt

FROM base as final

Expand All @@ -108,13 +110,15 @@ RUN apt-get -qq update \
ca-certificates \
curl \
dc \
libfftw3-3 \
libfftw3-single3 \
libfftw3-double3 \
libgomp1 \
liblapack3 \
libpng16-16 \
libquadmath0 \
libtiff5 \
libtiff5-dev \
pigz \
python3 \
python3-distutils \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -137,8 +141,8 @@ ENV ANTSPATH=/opt/ants/bin \
FSLMULTIFILEQUIT=TRUE \
FSLTCLSH=/opt/fsl/bin/fsltclsh \
FSLWISH=/opt/fsl/bin/fslwish \
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/fsl/lib:/opt/ants/lib:" \
PATH="/opt/mrtrix3/bin:/opt/ants/bin:/opt/art/bin:/opt/fsl/bin:$PATH"
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/ants/lib" \
PATH="/opt/mrtrix3/bin:/opt/ants/bin:/opt/art/bin:/opt/fsl/share/fsl/bin:$PATH"

ENTRYPOINT ["/bin/bash"]

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ These files should only need to be updated if:
mkdir -p tarballs
docker run --rm -itd --workdir /opt --name mrtrix3 \
--volume $(pwd)/tarballs:/output mrtrix3:minified bash
docker exec mrtrix3 bash -c "find art/ -type f | tar c --files-from=/dev/stdin | pigz -9 > /output/acpcdetect_<version>.tar.gz"
docker exec mrtrix3 bash -c "find ants/ -type f | tar c --files-from=/dev/stdin | pigz -9 > /output/ants_<version>.tar.gz"
docker exec mrtrix3 bash -c "find fsl/ -type f | tar c --files-from=/dev/stdin | pigz -9 > /output/fsl_<version>.tar.gz"
docker exec mrtrix3 bash -c "find art/ \( -type f -o -type l \) | tar c --files-from=/dev/stdin | pigz -9 > /output/acpcdetect_<version>.tar.gz"
docker exec mrtrix3 bash -c "find ants/ \( -type f -o -type l \) | tar c --files-from=/dev/stdin | pigz -9 > /output/ants_<version>.tar.gz"
docker exec mrtrix3 bash -c "find fsl/ \( -type f -o -type l \) | tar c --files-from=/dev/stdin | pigz -9 > /output/fsl_<version>.tar.gz"
docker stop mrtrix3
```

Expand Down
3 changes: 2 additions & 1 deletion cmds-to-minify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@ cat /opt/ants/ANTSCopyright.txt
############################

cat ${FSLDIR}/source.txt
cat ${FSLDIR}/LICENCE
cat ${FSLDIR}/LICENCE.FSL
cat ${FSLDIR}/LICENSE.txt
cat ${FSLDIR}/etc/fslversion