From e2acb2d4563d5ca34bcebec64209453566084378 Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Thu, 1 Feb 2024 00:30:44 -0500 Subject: [PATCH] Include the image name as part of the tag The `--tag` option for `docker buildx imagetools create` expects a full image name and tag in the form user/app:tag. The example in the Docker documentation only produces the tag portion which results in the command attempting to push to the Docker library with the tag as the image target. Since our token has no such authorization it errors with ERROR: server message: insufficient_scope: authorization failed --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f068ed7..8fb410a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -645,15 +645,15 @@ jobs: working-directory: /tmp/digests run: | docker buildx imagetools create \ - $(jq -cr '.tags | map("--tag " + .) | join(" ")' \ + $(jq -cr '.tags | map("--tag ${{ env.IMAGE_NAME }}" + .) | join(" ")' \ <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *) - name: Create manifest list and push (GitHub Container Registry) working-directory: /tmp/digests run: | docker buildx imagetools create \ - $(jq -cr '.tags | map("--tag " + .) | join(" ")' \ - <<< "$DOCKER_METADATA_OUTPUT_JSON") \ + $(jq -cr '.tags | map("--tag ghcr.io/${{ env.IMAGE_NAME }}" + .) | \ + join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf 'ghcr.io/${{ env.IMAGE_NAME }}@sha256:%s ' *) - name: Inspect image run: |