Compare commits

...

2 Commits

Author SHA1 Message Date
Dustin 9ef70b2969 Avoid clobbering RPMDB in final container
ContainerImages/collectd/pipeline/head This commit looks good Details
Installing the RPMs in an alternate root and then copying the contents
of that root to the final container rootfs overwrites the RPM database
in the latter with the one from the former.  This isn't necessarily
a problem per se, but it makes troubleshooting difficult.  To avoid
this, we can install the RPMs directly in the final filesystem, which
mutates the RPMDB without overwriting it.
2024-05-25 11:43:25 -05:00
Dustin 18e3214424 Fix dependency install for collectd-sensors
I'm not sure what changed, but the *libi2c* package is no longer
required for *collectd-sensors*.  *lm_sensors-libs*, on the other hand,
is required; maybe it was before and I missed it.
2024-05-25 11:41:28 -05:00
1 changed files with 15 additions and 14 deletions

View File

@ -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/libi2c-*.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"]