-
Install docker-manger.conf and docker-instance.conf in /etc/init
-
Create a containers file in /etc/docker/ with the following format
name: image cmd
The name must be unique.
-
sudo service docker-manager start
-
You should now have upstart monitoring your container.
-
Use docker stop to kill your container and notice it gets restarted
Due to a bug in upstart (https://bugs.launchpad.net/upstart/+bug/568288) doing service docker-instance stop NAME=XXXX
fails to stop the instance. I'm not actually sure how to work around this.
To get this to work with images that are built with a CMD default, I replaced the docker run in line 49 with: