CentOS/RHEL images are pretty heavyweight by default without compression. For containers, one of the main reason is the use of all langpacks for glibc package (glibc-all-langpacks package or something like that) which can increase packages size. For example for Fedora images, the base Docker image used by Distrobuilder uses the glibc-minimal-langpack which helps to reduce RPM packages size by half (dunno why to be honest). I didn’t find a solution to use glibc-minimal langpack for my custom CentOS images for now (ruskofd/lxd-images: Manifests to build custom LXD container and virtual machine images using Distrobuilder (github.com)).
For VM images, I also remove the linux-firmware package for Fedora and CentOS images but it comes back on the next package upgrade if there any kernel update, because it’s a dependency for the kernel package…
Thanks for sharing Manifest and the simple but interesting idea of utilizing tempfs.
Similar, i try to build customized containers and keep the result image small as possible, but more radical by eliminating all those for the sake of legacy docs, man, manpages and much more, of decades ago where not much of online resources available.
Ubuntu comes out with 50M.
Also the image.yaml is dynamically and modular created from sub sets.
Yet I wonder, how using same image.yaml and distrobuilder parameter produces Centos 100M rootfs at jenkins and 600-700M on my server.
I’m investigating this. Jenkins builds the images with build-dir followed by pack-lxd. You are using build-lxd. In theory the output should be the same so there might be some bug in build-lxd.
distrobuilder 2.0 1125 latest/stable stgraber classic
Alpine,ubuntu,fedora,opnesuse … all work fine, centos has worked till weeks ago.
Build dir is zfs. Image.ymll
Sometimes override above source with a closer distro repository, but result gradually same. Goes for all centos, 7,8,8-stream,9-stream, rockylinux …
Indeed, there is something “wrong” here using Distrobuilder stable release. I also saw this change since I use the edge release of Distrobuilder for few months. Before, I can finish with a huge image of 1GB for a CentOS container, but now, it’s really stripped as expected (even with my supplementary packages). I don’t remember having problems with Fedora nor Ubuntu images.