Service execution (upstart / init.d) in the container

I am trying to start the system in docker with many init and upstart services and I get this error.

initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused 

All workarounds suggest making a hard link to / bin / true to disable this error. But I need these services to be controlled upstart to be able to restart, and to emit events for higher ones to work ...

Docker does not seem to support this, I am considering a rough hack of a script entry to run all services in /etc/rcX.d and track PID. This does not solve the problem of the absence of emissions from the upstart.

Any other ideas on how to run upstart processes in docker?

+7
docker init upstart
source share
2 answers

Unfortunately, the upstart does not work inside the docker container, because they do some magic with the init system.

This issue explains:

If your application uses upstart, it will not fit nicely in docker images, and even more if they redirect / sbin / init or / sbin / initctl to something like / bin / true or / dev / null. An application can use the service to run if it has an old V initscript school system, and if the initctl command was not distracted.

In the case of the salt minion on ubuntu, the package uses the upstart job and the classic init script, so it's normal that it does not start in both cases.

And this one says:

Since Docker replaces the default value / sbin / init with its own, it is not possible to start Upstart initialization inside the Docker container.

+11
source share

You must do this. This is really not a Docker Way, but it is very possible. Maybe you should just consider the phusion / baseimage base image, getting support for the built-in runit . If you prefer to use upstart just see how they implemented the entry point, /sbin/myinit and follow that.

+3
source share

All Articles