Why there is no init / initctl on the docker centos image
Using the public/common docker‘s centos image I was installing some services that required a /etc/init directory and I had a failure. I have further noticed that initctl does not exist, meaning that init was not run.
How can the centos image be used with a fully functional init process ?
docker run -t -i centos /bin/bash file /etc/init /etc/init: cannot open ... no such file or directory ( /etc/init ) initctl bash: initctl: command not found
One Solution collect form web for “Why there is no init / initctl on the docker centos image”
A Docker container is more analogous to a process than a VM. That process can spawn other processes though, and the sub-processes will run in the same container. A common pattern is to use a process supervisor like supervisord as described in the Docker documentation. In general though, it’s usually recommended to try and run one process per container if you can (so that, for example, you can monitor and cap memory and CPU at the process level).