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 kill lots of docker container processes effectively and faster?
  • AWS Docker Golang. 'eb deploy' error
  • installing Node modules on Docker: why are they disappearing?
  • WordPress site url issues when using local docker container
  • Accessing environment variables in Docker containers linked with --link
  • docker not responding when using different data directory
  • example:

    docker run -t -i centos /bin/bash
    file /etc/init
    /etc/init: cannot open ... no such file or directory ( /etc/init )
    bash: initctl: command not found

  • Error on script to clear cache docker container
  • docker pull manifest unknown blob errors
  • How to pass arguments to a Dockerfile?
  • Mount point not found
  • Can Jprofile connect to JVM running in docker
  • How to Ssh into docker container that is running inside Vagrant?
  • 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.