From 05b05a358f80b49901a4714b98c2cdb1348c5874 Mon Sep 17 00:00:00 2001 From: Shijiang Wei Date: Sun, 14 Feb 2016 16:55:46 +0800 Subject: [PATCH] request a new token before downloading each layer Fixes #20069 Signed-off-by: Shijiang Wei --- contrib/download-frozen-image-v2.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/download-frozen-image-v2.sh b/contrib/download-frozen-image-v2.sh index 81b047561e..111e3fa2ba 100755 --- a/contrib/download-frozen-image-v2.sh +++ b/contrib/download-frozen-image-v2.sh @@ -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