From fb21ae5931746eb8247ca50d770c54f583550be1 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Tue, 17 Sep 2024 10:04:45 +0200 Subject: [PATCH] Use virt-sparsify again to reduce image size Signed-off-by: Christian Berendt --- .cirrus.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index eb4c1aa..13c1203 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -31,7 +31,7 @@ build_task_template: &BUILD_TASK_TEMPLATE apt-get update while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do sleep 5; done; while fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1; do sleep 5; done; - apt-get install -y git make python3-pip curl jq unzip + apt-get install -y git make python3-pip curl jq unzip libguestfs-tools prepare_script: | git clone https://github.com/kubernetes-sigs/image-builder @@ -54,6 +54,12 @@ build_task_template: &BUILD_TASK_TEMPLATE mv image-builder/images/capi/output/ubuntu-2204-kube-v$IMAGE_IDENTIFIER/last-$IMAGE_IDENTIFIER . cat last-$IMAGE_IDENTIFIER + sparsify_script: | + pushd image-builder/images/capi/output/ubuntu-2204-kube-v$IMAGE_IDENTIFIER + find . -name '*.qcow2' -execdir bash -c 'x={}; virt-sparsify --in-place $x' \; + ls -lah + popd + push_script: | if [[ "$CIRRUS_BRANCH" == "main" ]]; then wget https://dl.min.io/client/mc/release/linux-amd64/mc