From a5c00c9ad98ce5936a4385665554afcf90b83a97 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Fri, 29 Nov 2024 19:19:11 +1100 Subject: [PATCH] docker library: debug image - work around buildah limitation --- scripts/docker-library-manifest.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/scripts/docker-library-manifest.sh b/scripts/docker-library-manifest.sh index 5ce501db..7a254cd5 100755 --- a/scripts/docker-library-manifest.sh +++ b/scripts/docker-library-manifest.sh @@ -51,12 +51,16 @@ devmanifest=$image # # PUSHIT - if the manifest if complete, i.e. all supported arches are there, we push # +if [ -n "$ubi" ]; then + arches=( linux/amd64 ) +else + arches=( linux/amd64 linux/arm64/v8 linux/ppc64le linux/s390x ) +fi manifest_image_cleanup() { local manifest=$1 buildah manifest rm "$manifest" || echo "already removed" - local arches=( linux/amd64 linux/arm64/v8 linux/ppc64le linux/s390x ) for arch in "${arches[@]}"; do # -f will remove all tags of same, like wordpress buildah rmi -f "${manifest}-${arch}" || echo "already gone" @@ -112,7 +116,17 @@ fi debugmanifest=${image}-debug -buildah bud --all-platforms --jobs 4 --manifest "$debugmanifest" --build-arg BASE="$image" -f "mariadb-docker/Containerfile.debug$ubi" +# --all-platforms incompatible with --build-arg +# https://github.com/containers/buildah/issues/5850 +# buildah bud --all-platforms --jobs 4 --manifest "$debugmanifest" --build-arg BASE="$image" -f "mariadb-docker/Containerfile.debug$ubi" + + +## intentionally array to simple +# shellcheck disable=SC2124 +archlist="${arches[@]}" +# comma separated +archlist=${archlist// /,} +buildah bud --platform "${archlist}" --jobs 4 --manifest "$debugmanifest" --build-arg BASE="$image" -f "mariadb-docker/Containerfile.debug$ubi" # now $debugmanifest is build, we can cleanup $devmanifest manifest_image_cleanup "$devmanifest" "$t"