Last active
August 29, 2015 14:09
-
-
Save tianon/1c82c8f9a44ae71c91a9 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
set -e | |
image='tianon/speedtest' | |
layer='b31651d7665036bcf58a0b6b0d7aca173daff87b003ec50621cb0fde8d68864f' | |
# docker inspect b31651d7665036bcf58a0b6b0d7aca173daff87b003ec50621cb0fde8d68864f | grep '"Size"' | |
# "Size": 580580561, | |
# ("Content-Length: 228991341" though...) | |
token="$(curl -sSL -o /dev/null -D- -H 'X-Docker-Token: true' "https://index.docker.io/v1/repositories/$image/images" | awk -F ':[[:space:]]*|\r' '$1 == "X-Docker-Token" { print $2 }')" | |
time curl -sSL -o /dev/null -D- -H "Authorization: Token $token" "https://registry-1.docker.io/v1/images/$layer/layer" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment