Skip to content

Instantly share code, notes, and snippets.

@tuhin47
Last active August 11, 2025 04:10
Show Gist options
  • Save tuhin47/17bc389ab2b9c5f301c41d94889b15d6 to your computer and use it in GitHub Desktop.
Save tuhin47/17bc389ab2b9c5f301c41d94889b15d6 to your computer and use it in GitHub Desktop.
!#/usr/bin/bash
SHA256_HASH='7a34573f0b9c952286b33d537f233cd5b708e12263733aa646e50c33f598f16c'
NAMESPACE='prom'
REPO_NAME='prometheus'
for i in {1..1000}; do
if [ $i -eq 100 ]; then
echo -e "\e[35mSleeping for 7 seconds on page $i...\e[0m"
sleep 7
fi
echo "Looking into page: $i"
result=$(curl -s "https://registry.hub.docker.com/v2/repositories/$NAMESPACE/$REPO_NAME/tags/?page=$i" | jq -r ".results[] | select(.[\"images\"][][\"digest\"] == \"sha256:$hash\" or .digest == \"sha256:$SHA256_HASH\")") || break
if [ ! -z "$result" ]; then
echo "$result" | jq '.'
break
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment