Can't build custom image using image build in docker

Hi,

I'm using openwrt 22.03 on a x86 machine with plenty of space and memory. I deployed the associated image builder docker image to create my custom image in case I need to do a new installation.

If I create a default image, it works but it failed when I want to add all the extra packages I installed:

Creating filesystem with parameters:
    Size: 109051904
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 6656
    Inode size: 256
    Journal blocks: 0
    Label: rootfs
    Blocks: 26624
    Block groups: 1
    Reserved blocks: 0
    Reserved block group size: 7
error: ext4_allocate_best_fit_partial: failed to allocate 1625 blocks, out of space?

By searching on the forum, I found that others facing a similar issue solved it by increasing the kernel and root fs size via the following settings:

CONFIG_TARGET_ROOTFS_PARTSIZE
CONFIG_TARGET_KERNEL_PARTSIZE

So I gave it a shot with the following ones:

CONFIG_TARGET_ROOTFS_PARTSIZE=128
CONFIG_TARGET_KERNEL_PARTSIZE=24

And it seems I was going in the right direction as the number of missed blocks significantly reduced:

Creating filesystem with parameters:
    Size: 134217728
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 8192
    Inode size: 256
    Journal blocks: 0
    Label: rootfs
    Blocks: 32768
    Block groups: 1
    Reserved blocks: 0
    Reserved block group size: 7
error: ext4_allocate_best_fit_partial: failed to allocate 177 blocks, out of space?

This is where I can't explain what's happening because if I keep increasing the root fs size to 130 for example then the number of missed blocs increase again !! Increasing the kernel fs size doesn't seem to have any impact.

Creating filesystem with parameters:
    Size: 136314880
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 4160
    Inode size: 256
    Journal blocks: 0
    Label: rootfs
    Blocks: 33280
    Block groups: 2
    Reserved blocks: 0
    Reserved block group size: 15
error: ext4_allocate_best_fit_partial: failed to allocate 5310 blocks, out of space?

Definitely not my area of expertise so seeking for some guidance on how to tune correctly those parameters.

Thanks for your help and support !!!