Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save LvargaDS/43468595ff56c1e54dde10c5fbf316fe to your computer and use it in GitHub Desktop.
Save LvargaDS/43468595ff56c1e54dde10c5fbf316fe to your computer and use it in GitHub Desktop.
Find the tag of a Docker image having only the SHA256
#!/bin/bash
SHA256_HASH="1bcc4a809b5dae81ccdd292bc7724ef2a1357f58a545fbdfd3076008af14d0d7"
for i in {1..1000}
do
URL="https://registry.hub.docker.com/v2/repositories/apache/superset/tags/?page=$i&page_size=100"
echo "Looking into page: $i $URL"
curl --silent --show-error "$URL" \
| grep "${SHA256_HASH}"
#| jq '.results[] | select(.["images"][]["digest"] == "sha256:'${SHA256_HASH}'")'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment