Skip to content

Commit 30ca9ef

Browse files
committed
chore(docker): Fetch AFNI tools from versioned Docker image
1 parent 9db8753 commit 30ca9ef

File tree

1 file changed

+11
-60
lines changed

1 file changed

+11
-60
lines changed

Dockerfile

Lines changed: 11 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,6 @@ RUN curl --cacert /usr/local/etc/fs-cert.pem \
3636
-sSL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.3.2/freesurfer-linux-ubuntu22_amd64-7.3.2.tar.gz \
3737
| tar zxv --no-same-owner -C /opt --exclude-from=/usr/local/etc/freesurfer7.3.2-exclude.txt
3838

39-
# AFNI
40-
FROM downloader as afni
41-
# Bump the date to current to update AFNI
42-
RUN echo "2023.07.20"
43-
RUN mkdir -p /opt/afni-latest \
44-
&& curl -fsSL --retry 5 https://afni.nimh.nih.gov/pub/dist/tgz/linux_openmp_64.tgz \
45-
| tar -xz -C /opt/afni-latest --strip-components 1 \
46-
--exclude "linux_openmp_64/*.gz" \
47-
--exclude "linux_openmp_64/funstuff" \
48-
--exclude "linux_openmp_64/shiny" \
49-
--exclude "linux_openmp_64/afnipy" \
50-
--exclude "linux_openmp_64/lib/RetroTS" \
51-
--exclude "linux_openmp_64/lib_RetroTS" \
52-
--exclude "linux_openmp_64/meica.libs" \
53-
# Keep only what we use
54-
&& find /opt/afni-latest -type f -not \( \
55-
-name "3dTshift" -or \
56-
-name "3dUnifize" -or \
57-
-name "3dAutomask" -or \
58-
-name "3dvolreg" -or \
59-
-name "3dNwarpApply" \
60-
\) -delete
61-
6239
# Micromamba
6340
FROM downloader as micromamba
6441

@@ -96,50 +73,24 @@ RUN apt-get update && \
9673
bc \
9774
ca-certificates \
9875
curl \
99-
git \
100-
gnupg \
76+
libgomp1 \
10177
lsb-release \
10278
netbase \
10379
xvfb && \
10480
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
10581

106-
# Configure PPAs for libpng12 and libxp6
107-
RUN GNUPGHOME=/tmp gpg --keyserver hkps://keyserver.ubuntu.com --no-default-keyring --keyring /usr/share/keyrings/linuxuprising.gpg --recv 0xEA8CACC073C3DB2A \
108-
&& GNUPGHOME=/tmp gpg --keyserver hkps://keyserver.ubuntu.com --no-default-keyring --keyring /usr/share/keyrings/zeehio.gpg --recv 0xA1301338A3A48C4A \
109-
&& 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 \
110-
&& 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
111-
112-
# Dependencies for AFNI; requires a discontinued multiarch-support package from bionic (18.04)
113-
RUN apt-get update -qq \
114-
&& apt-get install -y -q --no-install-recommends \
115-
ed \
116-
gsl-bin \
117-
libglib2.0-0 \
118-
libglu1-mesa-dev \
119-
libglw1-mesa \
120-
libgomp1 \
121-
libjpeg62 \
122-
libpng12-0 \
123-
libxm4 \
124-
libxp6 \
125-
netpbm \
126-
tcsh \
127-
xfonts-base \
128-
xvfb \
129-
&& 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 \
130-
&& dpkg -i /tmp/multiarch.deb \
131-
&& rm /tmp/multiarch.deb \
132-
&& apt-get install -f \
133-
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
134-
&& gsl2_path="$(find / -name 'libgsl.so.19' || printf '')" \
135-
&& if [ -n "$gsl2_path" ]; then \
136-
ln -sfv "$gsl2_path" "$(dirname $gsl2_path)/libgsl.so.0"; \
137-
fi \
138-
&& ldconfig
139-
14082
# Install files from stages
14183
COPY --from=freesurfer /opt/freesurfer /opt/freesurfer
142-
COPY --from=afni /opt/afni-latest /opt/afni-latest
84+
COPY --from=afni/afni_make_build:AFNI_25.2.09 \
85+
/opt/afni/install/libf2c.so \
86+
/opt/afni/install/libmri.so \
87+
/usr/local/lib/
88+
COPY --from=afni/afni_make_build:AFNI_25.2.09 \
89+
/opt/afni/install/3dNwarpApply \
90+
/opt/afni/install/3dWarp \
91+
/opt/afni/install/3drefit \
92+
/opt/afni/install/3dvolreg \
93+
/usr/local/bin/
14394

14495
# Simulate SetUpFreeSurfer.sh
14596
ENV OS="Linux" \

0 commit comments

Comments
 (0)