Last active
August 11, 2025 04:10
-
-
Save tuhin47/17bc389ab2b9c5f301c41d94889b15d6 to your computer and use it in GitHub Desktop.
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 characters
| !#/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