Skip to content

Instantly share code, notes, and snippets.

@sh41
sh41 / get-docker-image-tag-by-sha.sh
Created March 4, 2024 10:00 — forked from achetronic/get-docker-image-tag-by-sha.sh
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}'")'