Compare commits

...
3 changed files with 9 additions and 3 deletions

No files matched your search

+1
View File
@@ -133,6 +133,7 @@ jobs:
FORCE: ${{ steps.v.outputs.force }} FORCE: ${{ steps.v.outputs.force }}
run: | run: |
set -euo pipefail set -euo pipefail
docker buildx version
f=(); [ "$FORCE" = true ] && f=(--force) f=(); [ "$FORCE" = true ] && f=(--force)
scripts/attach-arm64-index.sh --repo "$REPO" --tag "$TAG" --plan-only "${f[@]}" scripts/attach-arm64-index.sh --repo "$REPO" --tag "$TAG" --plan-only "${f[@]}"
+7 -2
View File
@@ -73,9 +73,14 @@ bflag=(); [ -n "$builder" ] && bflag=(--builder "$builder")
# shellcheck disable=SC2086 # shellcheck disable=SC2086
it() { $IMAGETOOLS "$1" "${bflag[@]}" "${@:2}"; } it() { $IMAGETOOLS "$1" "${bflag[@]}" "${@:2}"; }
# tag_digest <ref>: manifest (index) digest of a ref; empty on failure. # tag_digest <ref>: manifest (index) digest of a ref = sha256 of its raw manifest bytes; empty on
# failure. (Not `--format {{.Manifest.Digest}}`: the CI runner's buildx 0.13.1 ignores it.)
tag_digest() { tag_digest() {
it inspect "$1" --format '{{.Manifest.Digest}}' 2>>"${ATTACH_STDERR:-/dev/stderr}" | tail -n 1 | tr -d '[:space:]' || true local h
h=$(it inspect --raw "$1" 2>/dev/null | sha256sum | cut -d' ' -f1) || return 0
# sha256 of empty input means the inspect produced nothing
[ "$h" = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ] && return 0
echo "sha256:$h"
} }
# arch_of <ref>: image config architecture; empty on failure. # arch_of <ref>: image config architecture; empty on failure.
arch_of() { arch_of() {
+1 -1
View File
@@ -37,7 +37,7 @@ if cmd == 'inspect':
raw = '--raw' in rest raw = '--raw' in rest
ref = [a for a in rest if not a.startswith('--') and not a.startswith('{{')][0] if not raw else rest[rest.index('--raw') + 1] ref = [a for a in rest if not a.startswith('--') and not a.startswith('{{')][0] if not raw else rest[rest.index('--raw') + 1]
if raw: if raw:
print(json.dumps(resolve(ref)[1])) sys.stdout.write(json.dumps(resolve(ref)[1], sort_keys=True))
elif '{{.Manifest.Digest}}' in rest: elif '{{.Manifest.Digest}}' in rest:
print(resolve(ref)[0]) print(resolve(ref)[0])
elif '{{json .Image}}' in rest: elif '{{json .Image}}' in rest: