Docker - Install supervisord in a Trusty container

Because supervisord needs Upstart to be running but docker only runs one process
at a time (When apt-get is running, upstart is not). So, to install supervisord in a docker container, I need to do some little tricks:


  • Prerequisites

# echo "deb http://archive.ubuntu.com/ubuntu trusty main universe" >> /etc/apt/sources.list
# apt-get update
# apt-get upgrade

To avoid the error "initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused" when installing supervisor:

# dpkg-divert --local --rename --add /sbin/initctl
# ln -s /bin/true /sbin/initctl


  • Install supervisord:

# apt-get install supervisor
# ln -s /usr/bin/supervisorctl /usr/local/bin/supervisorctl



References:
[0] https://github.com/docker/docker/issues/1024
[1] http://docs.docker.com/articles/using_supervisord/

Comments