Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sh41/f04aa3cd4040b6b2b85ff3407d3ffcc8 to your computer and use it in GitHub Desktop.
Save sh41/f04aa3cd4040b6b2b85ff3407d3ffcc8 to your computer and use it in GitHub Desktop.
Find the tag of a Docker image having only the SHA256
#!/bin/bash
SHA256_HASH="df41d97cb66f3407c9b728b4d553e3bc6f7a2ffa7b47633aa6e2422d612a5461"
for i in {1..1000}
do
echo "Looking into page: $i"
curl "https://registry.hub.docker.com/v2/repositories/nginxproxy/docker-gen/tags/?page=$i" \
| 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