-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathDockerfile.base
More file actions
142 lines (126 loc) · 5.46 KB
/
Copy pathDockerfile.base
File metadata and controls
142 lines (126 loc) · 5.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# XCP-D Docker base image
#
# Runtime environment with non-Python/non-conda dependencies.
# Ubuntu 22.04 LTS - Jammy
ARG BASE_IMAGE=ubuntu:jammy-20250730
#
# Download stages
#
# Utilities for downloading packages
FROM ${BASE_IMAGE} AS downloader
ENV DEBIAN_FRONTEND="noninteractive" \
LANG="en_US.UTF-8" \
LC_ALL="en_US.UTF-8" \
HOME="/home/xcp_d"
# Bump the date to refresh curl/certificates/etc
RUN echo "2025.02.25"
RUN apt-get update && \
apt-get install -y --no-install-recommends \
binutils \
bzip2 \
ca-certificates \
curl \
unzip && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
#
# Main stage
#
FROM ${BASE_IMAGE} AS base
# Configure apt
ENV DEBIAN_FRONTEND="noninteractive" \
LANG="en_US.UTF-8" \
LC_ALL="en_US.UTF-8"
# Install AFNI subset directly from AFNI Docker image
COPY --link --from=afni/afni_make_build:AFNI_25.2.09 \
/opt/afni/install/libf2c.so \
/usr/lib/x86_64-linux-gnu/libgsl.so \
/usr/lib/x86_64-linux-gnu/libgsl.so.23 \
/usr/lib/x86_64-linux-gnu/libgslcblas.so \
/usr/lib/x86_64-linux-gnu/libgslcblas.so.0 \
/opt/afni/install/libmri.so \
/usr/local/lib/
COPY --link --from=afni/afni_make_build:AFNI_25.2.09 \
/opt/afni/install/3dReHo \
/opt/afni/install/3dDespike \
/opt/afni/install/3dFWHMx \
/opt/afni-bin/
RUN chmod +x /opt/afni-bin/3dReHo /opt/afni-bin/3dDespike /opt/afni-bin/3dFWHMx
# Baseline system packages (libs for Workbench/FSL/AFNI)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
gnupg \
libgomp1 \
libopenblas0-openmp \
lsb-release \
netbase \
pandoc \
xvfb && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# PPAs and packages for FreeSurfer/Workbench (libpng12, libxp, netpbm, etc.)
RUN GNUPGHOME=/tmp gpg --keyserver hkps://keyserver.ubuntu.com --no-default-keyring --keyring /usr/share/keyrings/linuxuprising.gpg --recv 0xEA8CACC073C3DB2A \
&& GNUPGHOME=/tmp gpg --keyserver hkps://keyserver.ubuntu.com --no-default-keyring --keyring /usr/share/keyrings/zeehio.gpg --recv 0xA1301338A3A48C4A \
&& 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 \
&& 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
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
connectome-workbench=1.5.0-2 \
ed \
gsl-bin \
libglib2.0-0 \
libglu1-mesa-dev \
libglw1-mesa \
libjpeg62 \
libpng12-0 \
libxm4 \
libxp6 \
netpbm \
tcsh \
xfonts-base \
&& curl -sSL --retry 5 -o /tmp/multiarch.deb https://archive.ubuntu.com/ubuntu/pool/main/g/glibc/multiarch-support_2.27-3ubuntu1.5_amd64.deb \
&& dpkg -i /tmp/multiarch.deb \
&& rm /tmp/multiarch.deb \
&& apt-get install -f \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& gsl_path="$(ldconfig -p | awk '/libgsl\.so\.[0-9]+/{print $NF; exit}')" \
&& if [ -n "$gsl_path" ] && [ "$(basename "$gsl_path")" != "libgsl.so.0" ]; then ln -sfv "$gsl_path" "$(dirname "$gsl_path")/libgsl.so.0"; fi \
&& gslcblas_path="$(ldconfig -p | awk '/libgslcblas\.so\.[0-9]+/{print $NF; exit}')" \
&& if [ -n "$gslcblas_path" ] && [ "$(basename "$gslcblas_path")" != "libgslcblas.so.0" ]; then ln -sfv "$gslcblas_path" "$(dirname "$gslcblas_path")/libgslcblas.so.0"; fi \
&& ldconfig
# Download atlases from AtlasPack (stored in tar.gz file on Box)
RUN mkdir -p "/home/xcp_d/.cache/xcp_d" && \
curl -o AtlasPack.tar.gz -sSL "https://upenn.box.com/shared/static/0gxdoe77tuih5p9ainn4utdqj3kcq7p1.tar.gz" && \
tar -xzf AtlasPack.tar.gz && \
mv AtlasPack "/home/xcp_d/.cache/xcp_d/AtlasPack" && \
rm AtlasPack.tar.gz
# Download XCP-D atlases (stored in tar.gz file on Box)
RUN mkdir -p "/home/xcp_d/.cache/xcp_d" && \
curl -o XCPDAtlases.tar.gz -sSL "https://upenn.box.com/shared/static/4amxp72grenmp1up689k5oyn1i6nhunq.tar.gz" && \
tar -xzf XCPDAtlases.tar.gz && \
mv XCPDAtlases "/home/xcp_d/.cache/xcp_d/XCPDAtlases" && \
rm XCPDAtlases.tar.gz && \
find "/home/xcp_d/.cache/xcp_d" -type d -exec chmod go=u {} + && \
find "/home/xcp_d/.cache/xcp_d" -type f -exec chmod go=u {} +
# AFNI
ENV PATH="/opt/afni-bin:$PATH" \
AFNI_IMSAVE_WARNINGS="NO" \
AFNI_PLUGINPATH="/opt/afni-bin"
# FSL / runtime (FSLDIR is set in the main Dockerfile, pointing to the pixi env)
ENV LANG="C.UTF-8" \
LC_ALL="C.UTF-8" \
PYTHONNOUSERSITE=1 \
FSLOUTPUTTYPE="NIFTI_GZ" \
FSLMULTIFILEQUIT="TRUE" \
FSLLOCKDIR="" \
FSLMACHINELIST="" \
FSLREMOTECALL="" \
FSLGECUDAQ="cuda.q"
RUN ldconfig
WORKDIR /tmp
LABEL org.label-schema.name="xcp_d-base" \
org.label-schema.description="XCP-D base image - runtime dependencies without the xcp_d package" \
org.label-schema.url="https://xcp-d.readthedocs.io/" \
org.label-schema.vcs-url="https://github.com/PennLINC/xcp_d" \
org.label-schema.schema-version="1.0"