Last active
December 14, 2020 10:02
-
-
Save madsonic/3ee4662a778ffb06ab661894767f9626 to your computer and use it in GitHub Desktop.
check docker hub rate limit balance
This file contains 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
# annonymous | |
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 \ | |
| grep 'RateLimit' | |
# authenticated | |
# note that there should be no output | |
# https://docs.docker.com/docker-hub/download-rate-limit/#i-dont-see-any-ratelimit-headers | |
TOKEN=$(curl --user 'username: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 \ | |
| grep 'RateLimit' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment