Skip to content

Instantly share code, notes, and snippets.

@tthyer
Last active December 15, 2020 16:07
Show Gist options
  • Save tthyer/64f63cf075f9da570f30f7a8ce35dab8 to your computer and use it in GitHub Desktop.
Save tthyer/64f63cf075f9da570f30f7a8ce35dab8 to your computer and use it in GitHub Desktop.
Dockerhub decrements your limit even if it doesn't pull layers
# 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