mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-11-25 07:38:17 +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-mainline"
|
||||
BASE_URL=http://kernel.ubuntu.com/~kernel-ppa/mainline
|
||||
|
||||
TAGS=$(curl --silent -f -lSL https://registry.hub.docker.com/v1/repositories/${REPO}/tags)
|
||||
|
||||
build_image() {
|
||||
VERSION=$1
|
||||
KDIR=$2
|
||||
@@ -43,7 +45,10 @@ for KDIR in $KDIRS; do
|
||||
# Strip the Ubuntu release name for the tag and also the 'v' like with
|
||||
# the other kernel packages
|
||||
VERSION=$(echo $KDIR | grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+")
|
||||
DOCKER_CONTENT_TRUST=1 docker pull ${REPO}:${VERSION} && continue
|
||||
if echo $TAGS | grep -q "\"${VERSION}\""; then
|
||||
echo "${REPO}:${VERSION} exists"
|
||||
continue
|
||||
fi
|
||||
build_image ${VERSION} ${KDIR} && \
|
||||
DOCKER_CONTENT_TRUST=1 docker push ${REPO}:${VERSION}
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user