muse-workover

This commit is contained in:
humocs-man
2026-09-05 14:56:19 +02:00
parent fd328b024e
commit 1d340945c1
9 changed files with 68 additions and 133 deletions
+4 -3
View File
@@ -139,9 +139,10 @@ _rootful_load_image $target_image=image_name $tag=default_tag:
# If the image is found, load it into rootful podman
ID=$(just sudoif podman images --filter reference="${target_image}:${tag}" --format "'{{ '{{.ID}}' }}'")
if [[ "$ID" != "$USER_IMG_ID" ]]; then
# If the image ID is not found or different from user, copy the image from user podman to root podman
COPYTMP=$(mktemp -p "${PWD}" -d -t _build_podman_scp.XXXXXXXXXX)
just sudoif TMPDIR=${COPYTMP} podman image scp ${UID}@localhost::"${target_image}:${tag}" root@localhost::"${target_image}:${tag}"
# podman image scp ist deprecated (Podman 5) -> save/load verwenden
COPYTMP=$(mktemp -p "${PWD}" -d -t _build_podman_load.XXXXXXXXXX)
podman save "${target_image}:${tag}" -o "${COPYTMP}/image.tar"
just sudoif podman load -i "${COPYTMP}/image.tar"
rm -rf "${COPYTMP}"
fi
else