Skip to content

Instantly share code, notes, and snippets.

@tad-lispy
Created July 18, 2014 15:38
Show Gist options
  • Save tad-lispy/e8b46f8cdb67dafa33c7 to your computer and use it in GitHub Desktop.
Save tad-lispy/e8b46f8cdb67dafa33c7 to your computer and use it in GitHub Desktop.
Upstart Docker services with relaying on mongo container
description "Microserver container"
author "Tadeusz Łazurski <tadeusz@lazurski.pl>"
start on filesystem and started docker and started mongo-container
stop on runlevel [!2345]
respawn
exec /usr/bin/docker start -a microserver
pre-start exec sleep 30
description "Mongo container"
author "Tadeusz Łazurski <tadeusz@lazurski.pl>"
start on filesystem and started docker
stop on runlevel [!2345]
respawn
script
/usr/bin/docker start -a mongo
end script
@tad-lispy
Copy link
Author

Note 30 seconds sleep before start. It seems without it sometimes (not always) conteiner doesn't start with

Error response from daemon: Cannot start container microserver: Cannot link to a non running container: /mongo AS /microserver/mongo.

This seems to do the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment