diff --git a/resources/shell-tools/bin/push.sh b/resources/shell-tools/bin/push.sh index d6f7f9ba552d3b5e9814e6d88d2c498450a03523..4bdd00909b7b03e67d988509d7e4c351ead96153 100755 --- a/resources/shell-tools/bin/push.sh +++ b/resources/shell-tools/bin/push.sh @@ -26,8 +26,15 @@ printUsage() { exit 1 } -CONTAINER_CMD=podman +pushImageOrManifest() { + if podman manifest inspect "$1"; then + $CONTAINER_CMD manifest push --all --format v2s2 "$1" "docker://$1" + else + $CONTAINER_CMD push "$1" + fi +} +CONTAINER_CMD=podman if ! command -v "$CONTAINER_CMD" >/dev/null 2>&1; then CONTAINER_CMD=docker @@ -67,4 +74,4 @@ if [ "$CONTAINER_IMAGE_NAME" = "invalid" ]; then fi # shellcheck disable=SC2086 -$CONTAINER_CMD images --format "{{.Repository}}:{{.Tag}}" "$CONTAINER_IMAGE_NAME" | grep "$CONTAINER_IMAGE_NAME" | xargs -L 1 $CONTAINER_CMD push +$CONTAINER_CMD images --format "{{.Repository}}:{{.Tag}}" "$CONTAINER_IMAGE_NAME" | grep "$CONTAINER_IMAGE_NAME" | xargs -L 1 pushImageOrManifest