-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.base
More file actions
114 lines (100 loc) · 4.69 KB
/
Copy pathDockerfile.base
File metadata and controls
114 lines (100 loc) · 4.69 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
## BDT base image: runtime tools for the node-graph engine (MRtrix-free).
##
## Ships: Connectome Workbench (wb_command) + the Rust binaries giftirs + trxrs.
## Drops: AFNI (BOLD/fMRIPrep cruft — the node graph does not use it).
## Not here: ANTs — the engine uses ANTsPy (antspyx), a pip dep in the app image.
##
## NOTE — this image could not be build-tested locally; two things need a real
## `docker build` to confirm (search "VERIFY" below): the Workbench 2.x download
## URL and its Qt6 runtime libs.
##
## MIT License — see LICENSE for details.
# Ubuntu 22.04 LTS - Jammy (glibc 2.35; the Rust builder MUST match this so the
# statically-linked binaries load — never build them on bookworm/glibc 2.36).
ARG BASE_IMAGE=ubuntu:jammy-20250730
#
# Download / build stages
#
FROM ${BASE_IMAGE} AS downloader
ENV DEBIAN_FRONTEND="noninteractive" \
LANG="en_US.UTF-8" \
LC_ALL="en_US.UTF-8"
# Bump this date to refresh curl/certificates and bust the download cache.
RUN echo "2026.07.17"
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/*
# Connectome Workbench — bumped 1.5.0 -> 2.0.x to match the version every recipe
# in this project was validated against (2.0.1). 2.x is Qt6-based (1.5.0 was Qt5).
FROM downloader AS workbench
ARG WB_VERSION=2.0.1
# VERIFY: confirm this exact URL/filename on humanconnectome.org (2.x may ship a
# different archive name / a qt6 suffix). wb_command (CLI) is all we need here.
RUN mkdir /opt/workbench && \
curl -sSLO https://www.humanconnectome.org/storage/app/media/workbench/workbench-linux64-v${WB_VERSION}.zip && \
unzip workbench-linux64-v${WB_VERSION}.zip -d /opt && \
rm workbench-linux64-v${WB_VERSION}.zip && \
rm -rf /opt/workbench/libs_linux64_software_opengl /opt/workbench/plugins_linux64
# NOTE: ANTs is NOT installed here — the engine uses ANTsPy (antspyx), a pip
# dependency in the app image, for the one registration it computes (T1w<->ACPC).
# Rust binaries — giftirs (surface point-warp) + trxrs (streamlines). The crates
# live in separate GitHub repos (NOT in the build context), so install by git tag.
# Every crate builds hdf5 statically (hdf5-metno), so no system libhdf5 is needed.
FROM ${BASE_IMAGE} AS rustbuild
ENV DEBIAN_FRONTEND="noninteractive"
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cmake \
curl \
git \
perl \
pkg-config && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
sh -s -- -y --profile minimal --default-toolchain stable
ENV PATH="/root/.cargo/bin:${PATH}"
# itk-transforms-rs is an (unpinned) git dependency of both crates; the pinned
# tags below build reproducibly from each crate's committed Cargo.lock.
RUN cargo install --git https://github.com/pennlinc/gifti-rs.git --tag v0.1.0 --bin giftirs --root /opt/rust
RUN cargo install --git https://github.com/tee-ar-ex/trx-rs.git --tag v0.1.0 --bin trxrs --root /opt/rust
#
# Main stage
#
FROM ${BASE_IMAGE} AS base
ENV DEBIAN_FRONTEND="noninteractive" \
LANG="en_US.UTF-8" \
LC_ALL="en_US.UTF-8"
# Baseline system packages. Workbench 2.x is Qt6-based; libglib/libgl cover its
# headless (wb_command) runtime. libgomp/openblas are for ANTs.
# VERIFY: a Qt6 wb_command may pull additional libs (e.g. libegl1, libglx-mesa0);
# add them here if `wb_command -version` fails to load in a test build.
RUN apt-get update && \
apt-get install -y --no-install-recommends \
bc \
ca-certificates \
curl \
git \
libgl1 \
libglib2.0-0 \
libgomp1 \
libopenblas0-openmp \
netbase && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install from the build stages
COPY --link --from=workbench /opt/workbench /opt/workbench
COPY --link --from=rustbuild /opt/rust/bin /opt/rust/bin
ENV PATH="/opt/workbench/bin_linux64:/opt/rust/bin:$PATH" \
LD_LIBRARY_PATH="/opt/workbench/lib_linux64:$LD_LIBRARY_PATH"
RUN ldconfig
WORKDIR /tmp
LABEL org.label-schema.name="bdt-base" \
org.label-schema.description="BDT base image - Workbench + Rust (giftirs/trxrs), MRtrix-free" \
org.label-schema.url="https://github.com/nipreps/bdt" \
org.label-schema.schema-version="1.0"