A question about 'sysctl' in unpriviledged containers - Failed to setup sysctl parameters net.core.somaxconn to 4096

I’m playing around with lxd and “try” to run an docker-compose project inside an unprivileged container.
In der compose file, is the following part

  - net.core.somaxconn=4096

This breaks starting the docker-project. Remove these lines, it works.

However, I would like to understand how (if its even possible) to make the “full” compose file working.
One solution may be to switch to an privileged container, but I didn’t want to.

I tried, even if this is not my preffered way (and it doesn’t work either), lxc config set mailcow linux.sysctl.net.core.somaxconn=4096.
But with this setting, I get
lxc mailcow 20220824182603.878 ERROR conf - ../src/src/lxc/conf.c:setup_sysctl_parameters:3319 - No such file or directory - Failed to setup sysctl parameters net.core.somaxconn to 4096
So, is there an ways to make sysctl working from inside the container (except priv. con) or is the “only way” to disable the sysctl parameter and use a host-wide setting?

I have seen this with other settings and I simply apply those on the host and leave those that can work.

Fortunately I haven’t had a situation where settings for two VMs or containers would require conflicting or different settings.