1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

request a new token before downloading each layer

Fixes #20069

Signed-off-by: Shijiang Wei <mountkin@gmail.com>
This commit is contained in:
Shijiang Wei 2016-02-14 16:55:46 +08:00
parent 389a38e1e5
commit 05b05a358f

View file

@ -95,6 +95,7 @@ while [ $# -gt 0 ]; do
echo "skipping existing ${imageId:0:12}" echo "skipping existing ${imageId:0:12}"
continue continue
fi fi
token="$(curl -sSL "https://auth.docker.io/token?service=registry.docker.io&scope=repository:$image:pull" | jq --raw-output .token)"
curl -SL --progress -H "Authorization: Bearer $token" "https://registry-1.docker.io/v2/$image/blobs/$imageLayer" -o "$dir/$imageId/layer.tar" # -C - curl -SL --progress -H "Authorization: Bearer $token" "https://registry-1.docker.io/v2/$image/blobs/$imageLayer" -o "$dir/$imageId/layer.tar" # -C -
done done
echo echo