Why docker not executing init as lxc

containersinitlxc

Docker is not running init. So services are not started during startup. Lxc runs init during lxc-start.Since Docker is using lxc why it is not running init. What are the advantages of not running init and depending on supervisord for daemonization?

Best Answer

Docker is an application container, more focused in distribute apps as containers. In this the app/process running inside the container is the only one running, their init process. If your process need more apps (mysql, mongodb database, etc.) you don't launch these inside your docker container managed by one init daemon, you launch more docker containers, every one inside the docker container.

You can try http://phusion.github.io/baseimage-docker/ that provides a simple init daemon to run more process inside your docker image (this one is Ubuntu based) or you can try LXD http://www.ubuntu.com/cloud/lxd for container technology used more like a system container.