diff --git a/.github/workflows/builder-image.yml b/.github/workflows/builder-image.yml index 370a55d1..862c4a5e 100644 --- a/.github/workflows/builder-image.yml +++ b/.github/workflows/builder-image.yml @@ -117,13 +117,33 @@ jobs: type=raw,value=latest type=sha,format=long - - name: Create and push manifest list - env: - DOCKER_CLI_EXPERIMENTAL: enabled - run: | - docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "${{ steps.meta.outputs.json }}") \ - $(for file in /tmp/digests/*; do echo -n "${{ env.REGISTRY_IMAGE }}@$(cat $file) "; done) - + - name: Create and push manifest list + env: + DOCKER_CLI_EXPERIMENTAL: enabled + run: | + # Extract tags using jq and ensure proper formatting + TAGS=$(jq -cr '.tags[] | "-t " + .' <<< "${{ steps.meta.outputs.json }}") + + # Check if TAGS is empty + if [ -z "$TAGS" ]; then + echo "No tags found in JSON output." + exit 1 + fi + + # Create a manifest list using the image digests from /tmp/digests/* + DIGESTS=$(for file in /tmp/digests/*; do + echo -n "${{ env.REGISTRY_IMAGE }}@$(cat $file) " + done) + + # Verify DIGESTS is not empty + if [ -z "$DIGESTS" ]; then + echo "No digests found." + exit 1 + fi + + # Create the manifest list with the collected tags and digests + docker buildx imagetools create $TAGS $DIGESTS + - name: Inspect image run: | docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} \ No newline at end of file