diff --git a/Containerfile b/Containerfile index 02be00a..ecf6ab8 100644 --- a/Containerfile +++ b/Containerfile @@ -9,7 +9,7 @@ RUN --mount=type=cache,target=/var/cache \ RUN --mount=type=cache,target=/var/cache \ dnf install -y \ --downloadonly \ - --downloaddir=/var/cache/rpms \ + --downloaddir=/rpms \ --setopt=install_weak_deps=0 \ collectd \ collectd-chrony \ @@ -19,21 +19,22 @@ RUN --mount=type=cache,target=/var/cache \ collectd-write_prometheus \ && : -RUN --mount=type=cache,target=/var/cache \ - rpm -ivh -f --nodeps --root=/sysroot \ - /var/cache/rpms/collectd*.rpm \ - /var/cache/rpms/lm_sensors-libs-*.rpm \ - /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*' \ - && : - FROM registry.fedoraproject.org/fedora-minimal:40 -COPY --from=build /sysroot / +RUN --mount=type=cache,target=/var/cache \ + --mount=type=bind,from=build,source=/rpms,target=/rpms \ + microdnf install -y \ + --setopt=install_weak_deps=0 \ + cpio \ + && rpm -ivh -f --nodeps \ + /rpms/collectd*.rpm \ + /rpms/lm_sensors-libs-*.rpm \ + /rpms/libmicrohttpd-*.rpm \ + /rpms/libmnl-*.rpm \ + /rpms/protobuf-c-*.rpm \ + && rpm2cpio /rpms/nut-client-*.rpm \ + | cpio -i './usr/lib*/libupsclient.so.6*' \ + && : ENTRYPOINT ["/usr/sbin/collectd", "-f"]