Last active
December 15, 2020 16:07
-
-
Save tthyer/64f63cf075f9da570f30f7a8ce35dab8 to your computer and use it in GitHub Desktop.
Dockerhub decrements your limit even if it doesn't pull layers
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
# show that dockerhub is decrementing your allowed pulls when you re-request a "latest" image | |
sudo yum install jq | |
export TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -j '.token'); echo $TOKEN | |
while true; do | |
echo $(curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest 2>&1 | grep RateLimit-Remaining) | |
docker pull alpine:latest | |
sleep 3 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment