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?
2 Answers
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
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.
-
I dont think it is fixed. Iam using 0.7.1 docker. Still facing it. Init says /com/ubuntu/upstart sock not found. – kalyan Dec 19 '13 at 14:15
-
How are you invoking docker/init? – Andy Dec 19 '13 at 17:08
-
docker run ubuntu /sbin/init – kalyan Dec 19 '13 at 20:37
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.
![](../../users/profiles/277053.webp)
- 284
- 1
- 9