Last active
May 14, 2025 10:53
-
-
Save e-minguez/5ceea342b8b8d7893a61ec2236a2227c to your computer and use it in GitHub Desktop.
Revisions
-
e-minguez revised this gist
May 14, 2025 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,5 +14,6 @@ for tag in ${TAGS}; do DIGEST=$(crane digest ${IMAGE}:${tag} --platform ${PLATFORM} 2> /dev/null) if [[ ${DIGEST} == ${LATEST} ]]; then echo "latest=${tag}" exit 0 fi done -
e-minguez revised this gist
Oct 8, 2024 . 1 changed file with 6 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,17 @@ #!/bin/bash IMAGE="registry.opensuse.org/opensuse/busybox" OS="linux" ARCH="amd64" PLATFORM="${OS}/${ARCH}" LATEST=$(crane digest ${IMAGE}:latest --platform ${PLATFORM}) TAGS=$(crane ls ${IMAGE} | grep -v latest) for tag in ${TAGS}; do DIGEST=$(crane digest ${IMAGE}:${tag} --platform ${PLATFORM} 2> /dev/null) if [[ ${DIGEST} == ${LATEST} ]]; then echo "latest=${tag}" fi -
e-minguez created this gist
Oct 8, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ #!/bin/bash IMAGE="registry.opensuse.org/opensuse/busybox" LATEST=$(crane manifest ${IMAGE}:latest | jq -r '.manifests[] | select(.platform.architecture=="amd64") | .digest') TAGS=$(crane ls ${IMAGE} | grep -v latest) for tag in ${TAGS}; do DIGEST=$(crane manifest ${IMAGE}:${tag} | jq -r '.manifests[] | select(.platform.architecture=="amd64") | .digest') if [[ ${DIGEST} == ${LATEST} ]]; then echo "latest=${tag}" fi done