Does not require an additional file to start the services (supervisord.conf)
Start services the same way inside a container as it would outside the container
It's easier then supervisord to manage services' lifecycle (start/stop/restart)
It can run in a non-privileged container
It kills zombie processes
But mostly, it solves the problem we were having when the container restart without removing the PID files properly
What changed to do it:
The base image now is danielneto/systemd:centos7. Centos has an official image with systemd but it is missing a few commands and it seems they are not updating it anymore.
When running the container you have to mount /tmp and /run as tmpfs and /sys/fs/cgroup as read-only
Add capability SYS_PTRACE. Journald throws an error if you run without it.
As the run command now has a few extra parameters, I added a docker-compose file to make it easier to run the container.
Why to use systemd:
What changed to do it:
As the run command now has a few extra parameters, I added a docker-compose file to make it easier to run the container.