mirror of
https://github.com/henrygd/beszel.git
synced 2026-09-21 08:57:48 +02:00
Add ZFS pool/dataset utilities (zpool, zfs) to the full and slim nvidia agent images (#2311)
This commit is contained in:
@@ -43,6 +43,11 @@ COPY --from=builder /app/agent/test-data/amdgpu.ids /usr/share/libdrm/amdgpu.ids
|
|||||||
# Copy smartmontools binaries and config files
|
# Copy smartmontools binaries and config files
|
||||||
COPY --from=smartmontools-builder /usr/sbin/smartctl /usr/sbin/smartctl
|
COPY --from=smartmontools-builder /usr/sbin/smartctl /usr/sbin/smartctl
|
||||||
|
|
||||||
|
# Install ZFS userspace utilities (zpool, zfs) for pool/dataset monitoring
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
zfsutils-linux \
|
||||||
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Ensure data persistence across container recreations
|
# Ensure data persistence across container recreations
|
||||||
VOLUME ["/var/lib/beszel-agent"]
|
VOLUME ["/var/lib/beszel-agent"]
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,32 @@ RUN set -eux; \
|
|||||||
cp -v "$interp" "/out/rootfs$interp"; \
|
cp -v "$interp" "/out/rootfs$interp"; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# --------------------------
|
||||||
|
# ZFS utilities builder stage
|
||||||
|
# --------------------------
|
||||||
|
FROM --platform=$TARGETPLATFORM debian:bookworm-slim AS zfsutils-builder
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
zfsutils-linux \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Copy the zpool/zfs binaries and their required runtime libraries
|
||||||
|
RUN set -eux; \
|
||||||
|
mkdir -p /out/rootfs/lib /out/rootfs/lib64 /out/rootfs/usr/lib; \
|
||||||
|
for bin in /usr/sbin/zpool /usr/sbin/zfs; do \
|
||||||
|
mkdir -p "/out/rootfs$(dirname "$bin")"; \
|
||||||
|
cp -v "$bin" "/out/rootfs$bin"; \
|
||||||
|
ldd "$bin" \
|
||||||
|
| awk '{print $3}' \
|
||||||
|
| grep '^/' \
|
||||||
|
| xargs -r -I '{}' sh -c 'mkdir -p "/out/rootfs$(dirname "{}")"; cp -v "{}" "/out/rootfs{}"'; \
|
||||||
|
interp="$(ldd "$bin" | awk "/ld-linux/ {print \$1}")"; \
|
||||||
|
if [ -n "$interp" ] && [ -e "$interp" ]; then \
|
||||||
|
mkdir -p "/out/rootfs$(dirname "$interp")"; \
|
||||||
|
cp -v "$interp" "/out/rootfs$interp"; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
|
||||||
# --------------------------
|
# --------------------------
|
||||||
# Final image: lightweight multi-arch NVIDIA agent (slim)
|
# Final image: lightweight multi-arch NVIDIA agent (slim)
|
||||||
# --------------------------
|
# --------------------------
|
||||||
@@ -78,6 +104,9 @@ COPY --from=builder /app/agent/test-data/amdgpu.ids /usr/share/libdrm/amdgpu.ids
|
|||||||
COPY --from=smartmontools-builder /usr/sbin/smartctl /usr/sbin/smartctl
|
COPY --from=smartmontools-builder /usr/sbin/smartctl /usr/sbin/smartctl
|
||||||
COPY --from=smartmontools-builder /out/rootfs/ /
|
COPY --from=smartmontools-builder /out/rootfs/ /
|
||||||
|
|
||||||
|
# Copy ZFS utilities (zpool, zfs) binaries and required runtime libraries
|
||||||
|
COPY --from=zfsutils-builder /out/rootfs/ /
|
||||||
|
|
||||||
# nvidia-smi is intentionally not bundled.
|
# nvidia-smi is intentionally not bundled.
|
||||||
# Mount the host binary instead, for example:
|
# Mount the host binary instead, for example:
|
||||||
# - /usr/bin/nvidia-smi:/usr/bin/nvidia-smi:ro
|
# - /usr/bin/nvidia-smi:/usr/bin/nvidia-smi:ro
|
||||||
|
|||||||
Reference in New Issue
Block a user