SHELL file create
,
vi docker-RateLimit-Remaining.sh
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
Run shell script
,
./docker-RateLimit-Remaining.sh
Output
is ratelimit-remaining: 0, no image pull :(
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4415 0 4415 0 0 5021 0 --:--:-- --:--:-- --:--:-- 5017
HTTP/1.1 200 OK
content-length: 2782
content-type: application/vnd.docker.distribution.manifest.v1+prettyjws
docker-content-digest: sha256:767a334t534t5345i3b355bed31760d5fawer5ewr8wer7wwerew8rwpkrthdkote2020
docker-distribution-api-version: registry/2.0
etag: "sha256:767a334t534t5345i3b355bed31760d5fawer5ewr8wer7wwerew8rwpkrthdkote2020"
date: Fri, 09 Dec 2022 12:16:35 GMT
strict-transport-security: max-age=31536000
ratelimit-limit: 100;w=21600
ratelimit-remaining: 0;w=21600
docker-ratelimit-source: YOU_REAL_IP