You can use this image as a base container to run systemd services inside.
latest
,7
,8
- Run the container as a daemon
docker run -d --name systemd-centos --tmpfs /tmp --tmpfs /run --tmpfs /run/lock -v /sys/fs/cgroup:/sys/fs/cgroup:ro jrei/systemd-centos
or if it doesn't work
docker run -d --name systemd-centos --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro jrei/systemd-centos
- Enter to the container
docker exec -it systemd-centos sh
- Remove the container
docker rm -f systemd-centos