use chunkah for final image

This commit is contained in:
Julian Wefers
2026-06-27 22:27:31 +02:00
parent 4165798a02
commit 4b3cd2c1d4
3 changed files with 19 additions and 3 deletions
+1
View File
@@ -1 +1,2 @@
output output
out
+14 -2
View File
@@ -1,4 +1,6 @@
FROM quay.io/fedora/fedora-bootc:44 ARG CHUNKAH_CONFIG_STR
FROM quay.io/fedora/fedora-bootc:44 AS builder
# Install ZFS # Install ZFS
# we want to keep ALL dnf downloaded packages in dnf cache, # we want to keep ALL dnf downloaded packages in dnf cache,
@@ -11,7 +13,17 @@ RUN --mount=type=cache,target=/var/cache/libdnf5 <<EOF
# dnf install -y kernel-devel-$(uname -r | awk -F'-' '{print $1}') # dnf install -y kernel-devel-$(uname -r | awk -F'-' '{print $1}')
dnf install -y https://zfsonlinux.org/fedora/zfs-release-3-1$(rpm --eval "%{dist}").noarch.rpm dnf install -y https://zfsonlinux.org/fedora/zfs-release-3-1$(rpm --eval "%{dist}").noarch.rpm
dnf install -y zfs btop borgbackup dnf install -y zfs btop borgbackup
dnf clean all && rm -rf /run/dnf && rm -rf /tmp/* rm -rf /run/dnf && rm -rf /tmp/*
EOF EOF
RUN bootc container lint RUN bootc container lint
FROM quay.io/coreos/chunkah AS chunkah
ARG CHUNKAH_CONFIG_STR
RUN --mount=from=builder,src=/,target=/chunkah,ro \
--mount=type=bind,target=/run/src,rw \
chunkah build --prune /sysroot/ --max-layers 128 \
--label ostree.commit- --label ostree.final-diffid- \
--output oci:/run/src/out
FROM oci:out
+4 -1
View File
@@ -2,12 +2,15 @@ REPO="gitea.wefers.page/julian/backup-server"
TAG="latest" TAG="latest"
build() { build() {
# ABSOLUTELY DO NOT USE --squash, as ostree NEEDS the layers # --no-cache \
sudo buildah build \ sudo buildah build \
-t ${REPO}:${TAG} \ -t ${REPO}:${TAG} \
--build-arg CHUNKAH_CONFIG_STR="$(sudo podman inspect "quay.io/fedora/fedora-bootc:44")" \
--pull \ --pull \
--layers \ --layers \
--format oci \ --format oci \
--skip-unused-stages=false \
-v $(pwd):/run/src --security-opt=label=disable \
--network=host \ --network=host \
. .