A note on Docker
While systemctl
is a common tool for managing services on traditional Linux systems, it is generally not used in Docker containers due to containers’ isolated and self-contained nature.
Docker containers ideally run a single process and therefore don’t require a complex boot phase or process management. The container, in essence, is the process and doesn’t have access to the host system’s init system (including systemd
).
Although it’s possible to have access to these commands in a Docker container, it’s usually undesirable to use any kind of service-management system inside of them.
Docker containers ideally contain a single application and launch a single process when they start. For this, no service management is needed – the running container is your service package, and your Docker container essentially is your process.
We don’t recommend a Docker setup that includes multiple processes or...