Skip to content

Commit a88b22f

Browse files
committed
chore(docker): Install AFNI binaries from Docker image
1 parent 686a30d commit a88b22f

File tree

1 file changed

+19
-56
lines changed

1 file changed

+19
-56
lines changed

Dockerfile

Lines changed: 19 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -73,27 +73,6 @@ COPY docker/files/freesurfer7.3.2-exclude.txt /usr/local/etc/freesurfer7.3.2-exc
7373
RUN curl -sSL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.3.2/freesurfer-linux-ubuntu22_amd64-7.3.2.tar.gz \
7474
| tar zxv --no-same-owner -C /opt --exclude-from=/usr/local/etc/freesurfer7.3.2-exclude.txt
7575

76-
# AFNI
77-
FROM downloader AS afni
78-
# Bump the date to current to update AFNI
79-
RUN echo "2023.07.20"
80-
RUN mkdir -p /opt/afni-latest \
81-
&& curl -fsSL --retry 5 https://afni.nimh.nih.gov/pub/dist/tgz/linux_openmp_64.tgz \
82-
| tar -xz -C /opt/afni-latest --strip-components 1 \
83-
--exclude "linux_openmp_64/*.gz" \
84-
--exclude "linux_openmp_64/funstuff" \
85-
--exclude "linux_openmp_64/shiny" \
86-
--exclude "linux_openmp_64/afnipy" \
87-
--exclude "linux_openmp_64/lib/RetroTS" \
88-
--exclude "linux_openmp_64/lib_RetroTS" \
89-
--exclude "linux_openmp_64/meica.libs" \
90-
# Keep only what we use
91-
&& find /opt/afni-latest -type f -not \( \
92-
-name "3dTshift" -or \
93-
-name "3dUnifize" -or \
94-
-name "3dAutomask" -or \
95-
-name "3dvolreg" \) -delete
96-
9776
#
9877
# Main stage
9978
#
@@ -117,43 +96,27 @@ RUN apt-get update && \
11796
xvfb && \
11897
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
11998

120-
# Configure PPAs for libpng12 and libxp6
121-
RUN GNUPGHOME=/tmp gpg --keyserver hkps://keyserver.ubuntu.com --no-default-keyring --keyring /usr/share/keyrings/linuxuprising.gpg --recv 0xEA8CACC073C3DB2A \
122-
&& GNUPGHOME=/tmp gpg --keyserver hkps://keyserver.ubuntu.com --no-default-keyring --keyring /usr/share/keyrings/zeehio.gpg --recv 0xA1301338A3A48C4A \
123-
&& echo "deb [signed-by=/usr/share/keyrings/linuxuprising.gpg] https://ppa.launchpadcontent.net/linuxuprising/libpng12/ubuntu jammy main" > /etc/apt/sources.list.d/linuxuprising.list \
124-
&& echo "deb [signed-by=/usr/share/keyrings/zeehio.gpg] https://ppa.launchpadcontent.net/zeehio/libxp/ubuntu jammy main" > /etc/apt/sources.list.d/zeehio.list
125-
126-
# Dependencies for AFNI; requires a discontinued multiarch-support package from bionic (18.04)
127-
RUN apt-get update -qq \
128-
&& apt-get install -y -q --no-install-recommends \
129-
ed \
130-
gsl-bin \
131-
libglib2.0-0 \
132-
libglu1-mesa-dev \
133-
libglw1-mesa \
134-
libgomp1 \
135-
libjpeg62 \
136-
libpng12-0 \
137-
libxm4 \
138-
libxp6 \
139-
netpbm \
140-
tcsh \
141-
xfonts-base \
142-
xvfb \
143-
&& 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 \
144-
&& dpkg -i /tmp/multiarch.deb \
145-
&& rm /tmp/multiarch.deb \
146-
&& apt-get install -f \
147-
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
148-
&& gsl2_path="$(find / -name 'libgsl.so.19' || printf '')" \
149-
&& if [ -n "$gsl2_path" ]; then \
150-
ln -sfv "$gsl2_path" "$(dirname $gsl2_path)/libgsl.so.0"; \
151-
fi \
152-
&& ldconfig
153-
15499
# Install files from stages
155100
COPY --from=freesurfer /opt/freesurfer /opt/freesurfer
156-
COPY --from=afni /opt/afni-latest /opt/afni-latest
101+
102+
# Install AFNI from Docker container
103+
# Find libraries with `ldd $BINARIES | grep afni`
104+
COPY --from=afni/afni_cmake_build:AFNI_25.2.08 \
105+
/opt/afni/install/usr/local/lib/lib3DEdge.so \
106+
/opt/afni/install/usr/local/lib/libeispack.so \
107+
/opt/afni/install/usr/local/lib/libf2c.so \
108+
/opt/afni/install/usr/local/lib/libgiftiio.so.0 \
109+
/opt/afni/install/usr/local/lib/libmri.so \
110+
/opt/afni/install/usr/local/lib/libnifti2.so.2 \
111+
/opt/afni/install/usr/local/lib/libnifticdf.so.2 \
112+
/opt/afni/install/usr/local/lib/libznz.so.3 \
113+
/usr/local/lib
114+
COPY --from=afni/afni_cmake_build:AFNI_25.2.08 \
115+
/opt/afni/install/usr/local/bin/3dAutomask \
116+
/opt/afni/install/usr/local/bin/3dTshift \
117+
/opt/afni/install/usr/local/bin/3dUnifize \
118+
/opt/afni/install/usr/local/bin/3dvolreg \
119+
/usr/local/bin
157120

158121
# MSM HOCR (Nov 19, 2019 release)
159122
RUN curl -L -H "Accept: application/octet-stream" https://api.github.com/repos/ecr05/MSM_HOCR/releases/assets/16253707 -o /usr/local/bin/msm \

0 commit comments

Comments
 (0)