mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #33443 from DeliangFan/fix_download_image_fails
Fix downloading image fails when build docker
This commit is contained in:
commit
555bd548ca
1 changed files with 2 additions and 0 deletions
|
@ -157,6 +157,7 @@ while [ $# -gt 0 ]; do
|
||||||
echo "skipping existing ${layerId:0:12}"
|
echo "skipping existing ${layerId:0:12}"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
token="$(curl -fsSL "https://auth.docker.io/token?service=registry.docker.io&scope=repository:$image:pull" | jq --raw-output '.token')"
|
||||||
curl -fSL --progress \
|
curl -fSL --progress \
|
||||||
-H "Authorization: Bearer $token" \
|
-H "Authorization: Bearer $token" \
|
||||||
"https://registry-1.docker.io/v2/$image/blobs/$layerDigest" \
|
"https://registry-1.docker.io/v2/$image/blobs/$layerDigest" \
|
||||||
|
@ -229,6 +230,7 @@ while [ $# -gt 0 ]; do
|
||||||
echo "skipping existing ${layerId:0:12}"
|
echo "skipping existing ${layerId:0:12}"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
token="$(curl -fsSL "https://auth.docker.io/token?service=registry.docker.io&scope=repository:$image:pull" | jq --raw-output '.token')"
|
||||||
curl -fSL --progress -H "Authorization: Bearer $token" "https://registry-1.docker.io/v2/$image/blobs/$imageLayer" -o "$dir/$layerId/layer.tar" # -C -
|
curl -fSL --progress -H "Authorization: Bearer $token" "https://registry-1.docker.io/v2/$image/blobs/$imageLayer" -o "$dir/$layerId/layer.tar" # -C -
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Add table
Reference in a new issue