Skip to content

Commit deb3f76

Browse files
authored
MNT: Upgrade Docker base, c3d (#275)
* MNT: Upgrade Docker base, c3d * MNT: Clean up dockerfile * FIX: Use unknown version if not found * DKR: Ensure /home/nibabies is fully available
1 parent f8ca1ae commit deb3f76

File tree

2 files changed

+26
-25
lines changed

2 files changed

+26
-25
lines changed

Dockerfile

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ COPY . /src/nibabies
77
RUN python -m build /src/nibabies
88

99
# Ubuntu 20.04 LTS
10-
FROM ubuntu:focal-20221130
10+
FROM ubuntu:jammy-20221130
1111
ENV DEBIAN_FRONTEND="noninteractive" \
1212
LANG="en_US.UTF-8" \
1313
LC_ALL="en_US.UTF-8"
@@ -22,12 +22,11 @@ RUN apt-get update && \
2222
ca-certificates \
2323
curl \
2424
git \
25-
graphviz \
25+
gnupg \
2626
libtool \
2727
locales \
2828
lsb-release \
29-
pandoc \
30-
pandoc-citeproc \
29+
netbase \
3130
pkg-config \
3231
unzip \
3332
xvfb && \
@@ -44,6 +43,9 @@ WORKDIR $ANTSPATH
4443
RUN curl -sSL "https://dl.dropbox.com/s/gwf51ykkk5bifyj/ants-Linux-centos6_x86_64-v2.3.4.tar.gz" \
4544
| tar -xzC $ANTSPATH --strip-components 1
4645

46+
RUN GNUPGHOME=/tmp gpg --keyserver hkps://keyserver.ubuntu.com --no-default-keyring --keyring /usr/share/keyrings/linuxuprising.gpg --recv 0xEA8CACC073C3DB2A \
47+
&& 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
48+
4749
# # AFNI latest (neurodocker build)
4850
RUN apt-get update -qq \
4951
&& apt-get install -y -q --no-install-recommends \
@@ -54,6 +56,7 @@ RUN apt-get update -qq \
5456
libglw1-mesa \
5557
libgomp1 \
5658
libjpeg62 \
59+
libpng12-0 \
5760
libxm4 \
5861
netpbm \
5962
tcsh \
@@ -67,9 +70,6 @@ RUN apt-get update -qq \
6770
&& curl -sSL --retry 5 -o /tmp/libxp6.deb http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb \
6871
&& dpkg -i /tmp/libxp6.deb \
6972
&& rm /tmp/libxp6.deb \
70-
&& curl -sSL --retry 5 -o /tmp/libpng.deb http://snapshot.debian.org/archive/debian-security/20160113T213056Z/pool/updates/main/libp/libpng/libpng12-0_1.2.49-1%2Bdeb7u2_amd64.deb \
71-
&& dpkg -i /tmp/libpng.deb \
72-
&& rm /tmp/libpng.deb \
7373
&& apt-get install -f \
7474
&& apt-get clean \
7575
&& rm -rf /var/lib/apt/lists/* \
@@ -111,16 +111,6 @@ RUN echo "Downloading AFNI ..." \
111111
-name "3dAutomask" -or \
112112
-name "3dvolreg" \) -delete
113113

114-
# Convert3D (neurodocker build)
115-
RUN echo "Downloading Convert3D ..." \
116-
&& mkdir -p /opt/convert3d-1.0.0 \
117-
&& curl -fsSL --retry 5 https://sourceforge.net/projects/c3d/files/c3d/1.0.0/c3d-1.0.0-Linux-x86_64.tar.gz/download \
118-
| tar -xz -C /opt/convert3d-1.0.0 --strip-components 1 \
119-
--exclude "c3d-1.0.0-Linux-x86_64/lib" \
120-
--exclude "c3d-1.0.0-Linux-x86_64/share" \
121-
--exclude "c3d-1.0.0-Linux-x86_64/bin/c3d_gui"
122-
ENV C3DPATH="/opt/convert3d-1.0.0" \
123-
PATH="/opt/convert3d-1.0.0/bin:$PATH"
124114

125115
# FSL 6.0.5.1
126116
RUN apt-get update -qq \
@@ -213,7 +203,8 @@ ENV SUBJECTS_DIR="$FREESURFER_HOME/subjects" \
213203
MINC_BIN_DIR="$FREESURFER_HOME/mni/bin" \
214204
MINC_LIB_DIR="$FREESURFER_HOME/mni/lib" \
215205
MNI_DATAPATH="$FREESURFER_HOME/mni/data" \
216-
FSL_DIR=${FSLDIR}
206+
FSL_DIR=${FSLDIR} \
207+
FREESURFER="/opt/freesurfer"
217208
ENV PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5" \
218209
MNI_PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5" \
219210
PATH="$FREESURFER_HOME/bin:$FREESURFER_HOME/tktools:$MINC_BIN_DIR:$PATH"
@@ -242,16 +233,17 @@ ENV PATH="/opt/ICA-AROMA:$PATH" \
242233
AROMA_VERSION="0.4.5"
243234

244235
# Create a shared $HOME directory
245-
RUN useradd -m -s /bin/bash -G users nibabies
236+
RUN useradd -m -s /bin/bash -G users nibabies && chmod -R 777 /home/nibabies
246237
WORKDIR /home/nibabies
247-
ENV HOME="/home/nibabies"
238+
ENV HOME="/home/nibabies" \
239+
LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH}"
248240

249241
# py39_2209.01
250242
COPY --from=nipreps/miniconda@sha256:8894ca17e3c8ba963812a6876093463eab6b88871bcfe23f71ebc84cf38451db /opt/conda /opt/conda
251243

252244
RUN ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
253-
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
254-
echo "conda activate base" >> ~/.bashrc
245+
echo ". /opt/conda/etc/profile.d/conda.sh" >> ${HOME}/.bashrc && \
246+
echo "conda activate base" >> ${HOME}/.bashrc
255247

256248
# Set CPATH for packages relying on compiled libs (e.g. indexed_gzip)
257249
ENV PATH="/opt/conda/bin:$PATH" \
@@ -262,10 +254,19 @@ ENV PATH="/opt/conda/bin:$PATH" \
262254
IS_DOCKER_8395080871=1 \
263255
CONDA_PYTHON="/opt/conda/bin/python"
264256

257+
# Convert3d
258+
RUN conda install -y -n base \
259+
-c anaconda \
260+
-c conda-forge \
261+
convert3d=1.3.0 \
262+
&& sync \
263+
&& conda clean -afy; sync \
264+
&& rm -rf ~/.conda ~/.cache/pip/*; sync \
265+
&& ldconfig
266+
265267
# Precaching atlases
266268
COPY scripts/fetch_templates.py fetch_templates.py
267-
RUN ${CONDA_PYTHON} -m pip install --no-cache-dir templateflow && \
268-
${CONDA_PYTHON} fetch_templates.py && \
269+
RUN ${CONDA_PYTHON} fetch_templates.py && \
269270
rm fetch_templates.py && \
270271
find $HOME/.cache/templateflow -type d -exec chmod go=u {} + && \
271272
find $HOME/.cache/templateflow -type f -exec chmod go=u {} +

nibabies/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
try:
66
from ._version import __version__
77
except ImportError:
8-
__version__ == "0+unknown"
8+
__version__ = "0+unknown"
99

1010
__org__ = "nipreps"
1111
__packagename__ = "nibabies"

0 commit comments

Comments
 (0)