diff --git a/Containerfile b/Containerfile index 3fd53a0..ed54183 100644 --- a/Containerfile +++ b/Containerfile @@ -16,14 +16,12 @@ ############################################################################### ############################################################################### -# MULTI-STAGE BUILD ARCHITECTURE +# MULTI-STAGE BUILD ARCHITECTURE (Cache-Isolierung) ############################################################################### -FROM scratch AS ctx - -# Kopiere die Build-Skripte und die neuen Konfigurations-Artefakte in den Kontext +# Isolierte Kontext-Stage NUR für die Build-Skripte. +# Änderungen an /configs oder /scripts hebeln dadurch die DNF-Layer (1-5) NICHT mehr aus! +FROM scratch AS build-ctx COPY build /build -COPY configs /configs -COPY scripts /scripts ############################################################################### # BASE IMAGE @@ -38,35 +36,35 @@ FROM quay.io/fedora/fedora-kinoite:44 ############################################################################### # LAYER 1: Repositories einrichten (Ändert sich fast nie) -RUN --mount=type=bind,from=ctx,source=/build/10-repos.sh,target=/tmp/10-repos.sh \ +RUN --mount=type=bind,from=build-ctx,source=/build/10-repos.sh,target=/tmp/10-repos.sh \ --mount=type=cache,dst=/var/cache \ --mount=type=cache,dst=/var/log \ --mount=type=tmpfs,dst=/tmp \ bash /tmp/10-repos.sh && dnf5 clean all -# LAYER 2: Unerwünschte Pakete entfernen (Bereinigungsschicht) -RUN --mount=type=bind,from=ctx,source=/build/20-remove-packages.sh,target=/tmp/20-remove-packages.sh \ +# LAYER 2: Unerwünschte Pakete entfernen (Bereinigungsschicht - vorgezogen) +RUN --mount=type=bind,from=build-ctx,source=/build/20-remove-packages.sh,target=/tmp/20-remove-packages.sh \ --mount=type=cache,dst=/var/cache \ --mount=type=cache,dst=/var/log \ --mount=type=tmpfs,dst=/tmp \ bash /tmp/20-remove-packages.sh # LAYER 3: Virtualisierung & Tools (Großer Download - stark gecacht) -RUN --mount=type=bind,from=ctx,source=/build/30-virt.sh,target=/tmp/30-virt.sh \ +RUN --mount=type=bind,from=build-ctx,source=/build/30-virt.sh,target=/tmp/30-virt.sh \ --mount=type=cache,dst=/var/cache \ --mount=type=cache,dst=/var/log \ --mount=type=tmpfs,dst=/tmp \ bash /tmp/30-virt.sh # LAYER 4: Multimedia Stack (Großer Download - stark gecacht) -RUN --mount=type=bind,from=ctx,source=/build/40-multimedia.sh,target=/tmp/40-multimedia.sh \ +RUN --mount=type=bind,from=build-ctx,source=/build/40-multimedia.sh,target=/tmp/40-multimedia.sh \ --mount=type=cache,dst=/var/cache \ --mount=type=cache,dst=/var/log \ --mount=type=tmpfs,dst=/tmp \ bash /tmp/40-multimedia.sh # LAYER 5: Flatpak Vorbereitung (Winzig, ganz unten) -RUN --mount=type=bind,from=ctx,source=/build/50-prepare-flatpak-for-bazaar.sh,target=/tmp/50-prepare-flatpak-for-bazaar.sh \ +RUN --mount=type=bind,from=build-ctx,source=/build/50-prepare-flatpak-for-bazaar.sh,target=/tmp/50-prepare-flatpak-for-bazaar.sh \ --mount=type=tmpfs,dst=/tmp \ bash /tmp/50-prepare-flatpak-for-bazaar.sh @@ -104,4 +102,4 @@ RUN systemctl enable \ ############################################################################### # Wir räumen zuerst auf, validieren das System via bootc container lint RUN rm -rf /root/.cache/dnf/* && \ - bootc container lint + bootc container lint \ No newline at end of file