Grow cloud image root by 4 GB before customizing (Docker install filled the disk)
This commit is contained in:
1 parent
5a564aaa47
commit
665eadc8d6
2 files changed
+10
-1
No files matched your search
@@ -29,6 +29,11 @@ build_template() {
|
||||
local disk="$work/disk.qcow2"
|
||||
cp "$IMAGE_DIR/$(basename "$IMAGE_URL")" "$disk"
|
||||
|
||||
# The cloud image's root filesystem is only ~2 GB, too small for Docker.
|
||||
# Grow the image by 4 GB and the root partition (sda1) with it.
|
||||
qemu-img resize -q "$disk" +4G
|
||||
virt-customize -a "$disk" --run-command "growpart /dev/sda 1 && resize2fs /dev/sda1"
|
||||
|
||||
# Guest agent, extra packages, optional Docker, and an empty machine-id so clones get their own DHCP lease
|
||||
virt-customize -a "$disk" --install "qemu-guest-agent${PACKAGES:+,$PACKAGES}"
|
||||
if [ "${DOCKER:-0}" = 1 ]; then
|
||||
|
||||
Reference in new issue
Block a user