Slim down systemd for LXC container

I’m not a fan of Docker container and the microservice approach. Application containers limit me too much - especially only one process to be started. In contrast, I have too many unnecessary processes active in the system-container LXC with systemd. Unfortunately, more and more Debian packages require systemd.

Can we slim down systemd for LXC container so that only systemctl service start / stop works and the other (useless for a container) components are deactivated? Deactivation of the network manager is a known tweak. And the rest?

Hi!

This is a container image question, which means that you should be able to achieve what you need by creating a minimal container image. The tool that builds the container images found at the ubuntu: and images: repositories is distrobuilder, https://github.com/lxc/distrobuilder The configuration files for each container image can be found at https://github.com/lxc/lxc-ci/tree/master/images

I do not know the exact changes you have in mind. I suggest to give it a try and produce such a minimal container image for Debian so that it is possible to evaluate the benefits of the simplifications.