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 ?

  • How to COPY files of current directory to folder in Dockerfile
  • Nightwatch keeps giving 502 bad gateway
  • Dockerfile dependency installed properly but resulting image doesn't have it
  • Understanding Dockerfile CMD/ENTRYPOINT
  • Docker data container, boot2docker, and the local file system
  • Why would I need Docker for nodejs?
  • example:

    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
    

  • Pull image from another Docker Machine
  • [pacemaker]Docker compose autostart
  • error 7#7: *1 upstream prematurely closed connection while reading response header from upstream
  • error when install tools in docker container
  • Docker: cannot open port 8080
  • connect to mysql server in docker
  • 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).

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.