Docker Community Forums

Share and learn in the Docker community.

How to use systemd in a container?

docker

(Keithtt) #1

OS version: Debian Stretch
Docker version: 17.06.2-ce

As the title…


(Bryce Ryan) #2

Running systemd in a container is often/usually not recommended. This is a topic that has been discussed a few times in these forums. For a couple of potentially relevant articles, see

here
here

In short, per @dmaze : Systemd does a ton of things, and it's not really appropriate to run inside a Docker container. (It wants to do things like cgroup management that don't make sense; as the blog post you cited suggests, you need to force it to not run every single OS service; and you need to enable the dangerous --privileged option to do it.)