From 47940714f7b90f1308befe86a5b985a2d50cc958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kate=C5=99ina=20Medv=C4=9Bdov=C3=A1?= Date: Fri, 7 Nov 2025 16:56:49 +0100 Subject: [PATCH] Add package cleanup hook --- Containerfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Containerfile b/Containerfile index e1d63d3..2236aec 100644 --- a/Containerfile +++ b/Containerfile @@ -1,5 +1,6 @@ FROM docker.io/archlinux/archlinux:latest AS builder +RUN echo -e "[Trigger]\nOperation = Install\nOperation = Upgrade\nType = Package\nTarget = *\n\n[Action]\nDescription = Cleaning up package cache...\nDepends = coreutils\nWhen = PostTransaction\nExec = /usr/bin/rm -rf /var/cache/pacman/pkg\n" | tee /usr/share/libalpm/hooks/package-cleanup.hook ENV DRACUT_NO_XATTR=1 RUN pacman -Sy --noconfirm \ @@ -19,9 +20,7 @@ RUN pacman -Sy --noconfirm \ glib2 \ ostree \ shadow \ - ${DEV_DEPS} && \ - pacman -S --clean --noconfirm && \ - rm -rf /var/cache/pacman/pkg/* + ${DEV_DEPS} # Workaround due to dracut version bump, please remove eventually # FIXME: remove @@ -33,8 +32,7 @@ RUN --mount=type=tmpfs,dst=/tmp --mount=type=tmpfs,dst=/root \ make -C /tmp/bootc bin install-all install-initramfs-dracut && \ sh -c 'export KERNEL_VERSION="$(basename "$(find /usr/lib/modules -maxdepth 1 -type d | grep -v -E "*.img" | tail -n 1)")" && \ dracut --force --no-hostonly --reproducible --zstd --verbose --kver "$KERNEL_VERSION" "/usr/lib/modules/$KERNEL_VERSION/initramfs.img"' && \ - pacman -Rns --noconfirm base-devel git rust && \ - pacman -S --clean --noconfirm + pacman -Rns --noconfirm base-devel git rust # Setup a temporary root passwd (changeme) for dev purposes # RUN pacman -S