From 276454100667ddb7d4f19da54d3a3ee91b3d8b83 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Wed, 17 Jan 2024 10:51:35 -0600 Subject: [PATCH] Add NUT plugin The *collectd-nut* package pulls in *nut-client*, which in turn pulls in Python (for PyNUT). Since collectd only needs `libupsclient.so.6`, we can extact it from the *nut-client* package and install it manually, avoiding the dependency explosion. --- Containerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Containerfile b/Containerfile index 352b8a6..65e2195 100644 --- a/Containerfile +++ b/Containerfile @@ -1,5 +1,11 @@ FROM registry.fedoraproject.org/fedora:38 AS build +RUN --mount=type=cache,target=/var/cache \ + dnf install -y \ + --setopt=install_weak_deps=0 \ + cpio \ + && : + RUN --mount=type=cache,target=/var/cache \ dnf install -y \ --downloadonly \ @@ -8,6 +14,7 @@ RUN --mount=type=cache,target=/var/cache \ collectd \ collectd-chrony \ collectd-disk \ + collectd-nut \ collectd-sensors \ collectd-write_prometheus \ && : @@ -19,6 +26,9 @@ RUN --mount=type=cache,target=/var/cache \ /var/cache/rpms/libmicrohttpd-*.rpm \ /var/cache/rpms/libmnl-*.rpm \ /var/cache/rpms/protobuf-c-*.rpm \ + && cd /sysroot \ + && rpm2cpio /var/cache/rpms/nut-client-*.rpm \ + | cpio -i './usr/lib*/libupsclient.so.6*' \ && :