From a542c10bf2eadb5f98b628b8ba6e755a6e85d980 Mon Sep 17 00:00:00 2001 From: flymarq Date: Wed, 8 Oct 2025 12:24:46 +0200 Subject: [PATCH] Optional build with Podman (#206) * Fix for podman usage The output of load command in docker and podman differs: - docker produces only one line of output the sha256 hash at 4th position - podman produces mulktiple lines of output with sha256 hash in the last line at third position This patch filters the line with hash and print the last argument, which is the hash. It works with docker and podman. Signed-off-by: flymarq * Add hints for building with podman Provide a simple command toi replace all relevant calls to docker with podman to enable a daemon less run. Signed-off-by: flymarq --------- Signed-off-by: flymarq --- README.md | 5 +++++ import | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f555c66..fab85c7 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,11 @@ To test the resulting image: $ sudo make test-trixie ``` +Building the image with podman instead of docker is possible, if you replace docker with podman in 4 scripts: +``` +$ sed -i "s/docker /podman /g" buildone dockerdiff import test +``` + ## Building Minideb for foreign architecture Make commands shown above will build an image for the architecture you are currently working on. To build an image for a foreign architecture (for example to build a multi-arch image), we provide a diff --git a/import b/import index ef1708e..3b98ffb 100755 --- a/import +++ b/import @@ -31,7 +31,7 @@ import() { local MANIFEST="$(echo -n "$MANIFEST_TEMPLATE" | sed -e "s/%CONF_SHA%/$CONF_SHA/g" -e "s/%LAYERSUM%/$LAYERSUM/g")" echo -n "$MANIFEST" > $TDIR/manifest.json tar cf $TDIR/import.tar -C $TDIR manifest.json "${CONF_SHA}.json" "$LAYERSUM" - local ID=$(docker load -i $TDIR/import.tar | awk '{print $4}') + local ID=$(docker load -i $TDIR/import.tar | grep Loaded\ image | awk '{print $NF}') if [ "$ID" != "sha256:$CONF_SHA" ]; then echo "Failed to load $ID correctly, expected id to be $CONF_SHA, source in $TDIR" >&2 exit 1