Skip to content

Commit

Permalink
docker library: debug image - work around buildah limitation
Browse files Browse the repository at this point in the history
  • Loading branch information
grooverdan committed Nov 29, 2024
1 parent a1d43fc commit a5c00c9
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions scripts/docker-library-manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit a5c00c9

Please sign in to comment.