From 474ae3b4efb1a2d33e3542d8b76c0882348a66eb Mon Sep 17 00:00:00 2001 From: Michael Hofmann Date: Nov 26 2020 10:48:27 +0000 Subject: Sync multi-arch ELN container images - also sync aarch64, ppc64le and s390x images - create a multi-arch manifest Signed-off-by: Michael Hofmann --- diff --git a/sync-latest-container-base-image.sh b/sync-latest-container-base-image.sh index f823cea..d0973c2 100755 --- a/sync-latest-container-base-image.sh +++ b/sync-latest-container-base-image.sh @@ -1,5 +1,8 @@ #!/bin/bash +image_repo=quay.io/fedoraci/fedora +arches=(aarch64 ppc64le x86_64 s390x) + eln_build_name=$(koji -q latest-build --type=image eln-updates-candidate Fedora-Container-Base | awk '{print $1}') if [[ -n ${eln_build_name} ]]; then # Download the image @@ -7,9 +10,17 @@ if [[ -n ${eln_build_name} ]]; then pushd ${work_dir} &> /dev/null koji download-build --type=image ${eln_build_name} - # Import the image - xz -d ${eln_build_name}.x86_64.tar.xz - skopeo copy --dest-creds="$USERNAME:$PASSWORD" docker-archive:${eln_build_name}.x86_64.tar docker://quay.io/fedoraci/fedora:eln-x86_64 + # Import the images + for arch in "${arches[@]}"; do + xz -d ${eln_build_name}.${arch}.tar.xz + skopeo copy --dest-creds="$USERNAME:$PASSWORD" docker-archive:${eln_build_name}.${arch}.tar "docker://$image_repo:eln-${arch}" + done + + # Create and upload multi-arch manifest + buildah rmi "$image_repo:eln" # jic the manifest already exists + buildah manifest create "$image_repo:eln" "${arches[@]/#/docker://$image_repo:eln-}" + buildah manifest push --creds="$USERNAME:$PASSWORD" "$image_repo:eln" "docker://$image_repo:eln" --all + popd &> /dev/null printf "Removing temporary directory\n"