Skip to content

Instantly share code, notes, and snippets.

@jbott
Last active February 9, 2016 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbott/4640f881f9c97d675a33 to your computer and use it in GitHub Desktop.
Save jbott/4640f881f9c97d675a33 to your computer and use it in GitHub Desktop.
A docker container systemd service file. This has no support for container dependencies.
[Unit]
Description=Docker %i container
Requires=docker.service
After=docker.service
[Service]
Restart=always
ExecStart=/usr/bin/docker start -a %I
ExecStop=/usr/bin/docker stop -t 2 %I
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment