does it work on hosts without systemd? #209
|
hello, |
Replies: 1 comment 1 reply
|
systemd only runs inside the container, as its PID 1; the host does not need it. What the host has to provide is a cgroup layout that systemd inside can use, and that depends on how your init mounts I checked it on a Docker host without systemd: a For your two hosts, check what is mounted at A single Alpine with OpenRC mounts cgroup v2 unless you changed it, from Alpine 3.19 on: Slackware is the one to watch. The stock Two ways around it. On Slackware -current, I could not test that last part end to end, because my lab would not let me mount a cgroup v1 hierarchy. |
systemd only runs inside the container, as its PID 1; the host does not need it. What the host has to provide is a cgroup layout that systemd inside can use, and that depends on how your init mounts
/sys/fs/cgroup, not on the init itself.I checked it on a Docker host without systemd: a
docker:dindcontainer in its own cgroup namespace, whose PID 1 isdocker-init, with dockerd on thecgroupfsdriver and cgroup v2. I ran the image with the settings from this repo'sdocker-compose.yaml(cgroup: host,/sys/fs/cgroup:/sys/fs/cgroup:rw, the tmpfs mounts,NET_RAWandNET_ADMIN). The systemd inside is 247 (the image is Debian 11), it reachedrunningwith 19 services up and none failed, and the w…