mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-05-04 09:15:21 +00:00
kernels: Don't pull to check if image exists on hub
Doing a "docker pull" to check if an image exist on hub takes a long time for the number of images, in particular in the linuxkit/kernel-mainline repo. Instead, get a list of tags on Hub and check that way. This does not check if the image was signed, but should be good enough. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
REPO="linuxkit/kernel-debian"
|
||||
BASE_URL=http://mirrors.kernel.org/debian/pool/main/l/linux/
|
||||
|
||||
TAGS=$(curl --silent -f -lSL https://registry.hub.docker.com/v1/repositories/${REPO}/tags)
|
||||
|
||||
ARCH=amd64
|
||||
LINKS=$(curl -s ${BASE_URL}/ | sed -n 's/.*href="\([^"]*\).*/\1/p')
|
||||
# Just get names for 4.x kernels
|
||||
@@ -13,8 +15,10 @@ for KERN_DEB in $KERNELS; do
|
||||
VERSION=$(echo $KERN_DEB | \
|
||||
grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+-[0-9]\+" | head -1)
|
||||
|
||||
echo "$VERSION -> $KERN_DEB"
|
||||
DOCKER_CONTENT_TRUST=1 docker pull ${REPO}:${VERSION} && continue
|
||||
if echo $TAGS | grep -q "\"${VERSION}\""; then
|
||||
echo "${REPO}:${VERSION} exists"
|
||||
continue
|
||||
fi
|
||||
|
||||
URLS="${BASE_URL}/${KERN_DEB}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user