Skip to content

Instantly share code, notes, and snippets.

@drubb
Created March 31, 2025 11:11
Show Gist options
  • Select an option

  • Save drubb/7ee05ea89f11757586a6f304317f33d5 to your computer and use it in GitHub Desktop.

Select an option

Save drubb/7ee05ea89f11757586a6f304317f33d5 to your computer and use it in GitHub Desktop.
Shellscript to check Docker Hub rate limits for anonymous and authenticated users. Use your own Docker credentials!
#!/bin/sh
echo 'Docker Hub rate limits for anonymous users:'
TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest
echo 'Docker Hub rate limits for authenticated users:'
TOKEN=$(curl --user 'user:password' "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment