Created
March 2, 2015 23:36
-
-
Save gdoteof/ba8d7f9e6cc0c30cc95e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Description=My thing | |
# Requirements | |
Requires=etcd.service | |
Requires=docker.service | |
# Dependency ordering | |
After=etcd.service | |
After=docker.service | |
[Service] | |
# Let processes take awhile to start up (for first run Docker containers) | |
TimeoutStartSec=0 | |
# work correctly. | |
KillMode=none | |
# Get CoreOS environmental variables | |
EnvironmentFile=/etc/environment | |
# Pre-start and Start | |
ExecStartPre=-/usr/bin/docker kill mything-%i | |
ExecStartPre=-/usr/bin/docker rm mything-%i | |
ExecStartPre=/usr/bin/docker pull gdoteof/my-image | |
ExecStart=/usr/bin/docker run -d --name mything-%i gdoteof/my-image my_command $VAR1 $VAR2 $VAR3 | |
# Stop | |
ExecStop=/usr/bin/docker stop mything-%i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment