fixed the debian build and reduced the size

Dieser Commit ist enthalten in:
Sebastian Tobie 2025-03-07 23:13:04 +01:00
Ursprung 016ea0de59
Commit 0646274502
4 geänderte Dateien mit 23 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -10,14 +10,21 @@ debian_install(){
buildah run --user 0:0 "$1" apt install /tmp/package.deb
}
debian_selection(){
selectionfile="$2"
buildah copy "$1" "$selectionfile" /tmp/seed
buildah run --user 0:0 "$1" debconf-set-selections /tmp/seed
}
init_container "$container" "docker.io/debian:${version}"
buildah config -e DEBIAN_FRONTEND=noninteractive "$container"
debian_list=$(mktemp)
sed "s;VERSION;${version};g" repos/debian.list >"$debian_list"
buildah run --user 0:0 "$container" apt update
buildah run --user 0:0 "$container" apt install -y ca-certificates
buildah copy "$container" "$debian_list" /etc/apt/sources.list.d/eigene.list
buildah run --user 0:0 "$container" apt update
debian_selection "$container" selections.txt
buildah run --user 0:0 "$container" apt install -y build-essential nodejs git git-buildpackage
commit "$container" "oci:debian:${version}"

10
cleanup.sh Ausführbare Datei
Datei anzeigen

@ -0,0 +1,10 @@
#!/bin/sh
mount=$(buildah mount $1)
[ -z "$mount" ] && (echo "no mount given" ;exit 1)
rm -rf "$mount"/usr/share/doc/*
rm -rf "$mount"/usr/share/man/*
rm -rf "$mount"/usr/share/locale/*
rm -rf "$mount"/var/lib/apt/lists/*
rm -rf "$mount"/var/cache/*
rm -rf "$mount"/tmp/*
hardlink -potm --reflink=always $mount

Datei anzeigen

@ -11,9 +11,11 @@ init_container () {
}
commit(){
buildah config -e - -l - -a - -p - "$1"
buildah config -e PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" "$1"
buildah commit --rm -f oci --squash "$1" "$2"
local container="$1"
buildah config -e - -l - -a - -p - "$container"
buildah config -e PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" "$container"
buildah unshare ./cleanup.sh "$container"
buildah commit --rm -f oci --squash "$container" "$2"
trap - EXIT
}

1
selections.txt Normale Datei
Datei anzeigen

@ -0,0 +1 @@
pbuilder pbuilder/mirrorsite string https://deb.debian.org/debian