1

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?

kalyan
  • 229
  • 1
  • 2
  • 11

2 Answers2

1

This question has been raised as an issue on GitHub, and a pull request merged to allow init to be run since 0.6.x):

docker run $IMAGE /sbin/init

source

The original reason init wasn't run (not valid since 0.6.x):

when starting a new container, docker mint-bounds itself as /sbin/init inside the container, hiding the real /sbin/init and in the proces smaking it unavailable for execution.

This answer may offer more help, and The Docker Guidebook may come in handy.

Andy
  • 5,190
  • 23
  • 34
1

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.

Yonsy Solis
  • 284
  • 1
  • 9