Bladeren bron

Merge pull request #20308 from mountkin/fix-20069

request a new token before downloading each layer
David Calavera 9 jaren geleden
bovenliggende
commit
556b1369de
1 gewijzigde bestanden met toevoegingen van 1 en 0 verwijderingen
  1. 1 0
      contrib/download-frozen-image-v2.sh

+ 1 - 0
contrib/download-frozen-image-v2.sh

@@ -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