Debian Codegraph @

scripts/docker/spin-xrootd/Dockerfile

raw
1 # SPDX-FileCopyrightText: 2026 Oak Ridge National Laboratory and Contributors
2 #
3 # SPDX-License-Identifier: Apache-2.0
4
5 FROM --platform=linux/amd64 fedora:latest@sha256:781b7642e8bf256e9cf75d2aa58d86f5cc695fd2df113517614e181a5eee9138
6
7 # Install development tools
8 RUN dnf update -y && \
9 dnf upgrade -y && \
10 dnf group -y install c-development development-tools
11
12 # Install XRootD and dependencies
13 # Note: xrootd-* installs all XRootD components including HTTP plugin
14 RUN dnf install -y cmake git 'xrootd-*' libcurl-devel openssl && \
15 dnf clean all && \
16 rm -rf /var/cache/dnf
17
18 # Copy configuration files from build context (scripts/docker/spin-xrootd/)
19 COPY xrootd-http.cfg /etc/xrootd/xrootd-http.cfg
20 COPY docker-entrypoint.sh /docker-entrypoint.sh
21 RUN chmod +x /docker-entrypoint.sh
22
23 # Clone and build ADIOS2 with XRootD and CURL support from GitHub
24 ARG ADIOS2_REPO=https://github.com/ornladios/ADIOS2.git
25 ARG ADIOS2_BRANCH=master
26
27 # Cache bust: change this arg to force re-clone when branch has new commits
28 ARG CACHEBUST=0
29
30 # Build, install, create test data, then remove source entirely
31 RUN git clone --depth 1 --branch ${ADIOS2_BRANCH} ${ADIOS2_REPO} /ADIOS2-src && \
32 mkdir -p /ADIOS2-src/build && \
33 cd /ADIOS2-src/build && \
34 cmake \
35 -DADIOS2_USE_XRootD=ON \
36 -DADIOS2_USE_CURL=ON \
37 -DADIOS2_USE_MPI=OFF \
38 -DADIOS2_USE_Fortran=OFF \
39 -DADIOS2_USE_Python=OFF \
40 -DADIOS2_USE_SST=OFF \
41 -DBUILD_TESTING=OFF \
42 -DCMAKE_BUILD_TYPE=Release \
43 -DCMAKE_INSTALL_PREFIX=/usr/local \
44 .. && \
45 make -j$(nproc) && \
46 make install && \
47 rm -rf /ADIOS2-src
48
49 # Create directories for XRootD with world-writable permissions
50 # Spin runs containers with arbitrary UIDs, so we can't rely on ownership
51 RUN mkdir -p /var/spool/xrootd/adios /run/xrootd/adios /etc/xrootd/certs /var/log/xrootd /tmp/adios /data && \
52 chmod -R 1777 /var/spool/xrootd /run/xrootd /var/log/xrootd /tmp/adios /data
53
54 # Generate self-signed SSL certificate at build time
55 # Written to /tmp so any UID can read them at startup
56 # The entrypoint will copy and fix permissions for XRootD
57 RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
58 -keyout /tmp/server.key \
59 -out /tmp/server.crt \
60 -subj "/CN=localhost" \
61 -batch && \
62 chmod 644 /tmp/server.key /tmp/server.crt
63
64 # Expose HTTP port (Spin Ingress will terminate TLS and forward to this port)
65 EXPOSE 8080
66
67 # Health check - verify XRootD HTTP is responding
68 # We check port 8080 is accepting connections (the /ssi endpoint requires POST data)
69 HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
70 CMD curl -sf -o /dev/null http://localhost:8080/ || exit 1
71
72 ENTRYPOINT ["/docker-entrypoint.sh"]