1
0
mirror of https://github.com/docker/cli.git synced 2026-01-19 21:41:31 +03:00

Merge pull request #20308 from mountkin/fix-20069

request a new token before downloading each layer
Upstream-commit: 556b1369de0a776918cb38a0177d219888005705
Component: engine
This commit is contained in:
David Calavera
2016-02-16 09:55:23 -08:00

View File

@@ -95,6 +95,7 @@ while [ $# -gt 0 ]; do
echo "skipping existing ${imageId:0:12}"
continue
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 -
done
echo