packer-plugin-arm-image icon indicating copy to clipboard operation
packer-plugin-arm-image copied to clipboard

Shrinking filesystem after provisioning

Open sassanh opened this issue 1 year ago • 0 comments

When I create an image based on rpi-bookworm-lite-arm64 which is ~450MB in xz format and ~2.6GB when uncompressed, the filesystem doesn't have enough room for provisioning commands I run (simple commands like apt install ...) So I set the target image size to 3.5GB and all goes well, but then the created image is ~1.25GB when gzipped.

Currently I'm thinking maybe I can run apt clean to remove Debian package files and apt caches and then run zerofree on the filesystem and it should help gzip to compress the image much more. Is it ok or is there any official method for dealing with this issue in packer or packer-plugin-arm-image?

sassanh avatar Feb 12 '24 20:02 sassanh