Last active
August 29, 2015 14:05
-
-
Save sheldonh/2eb434818c4d254354f4 to your computer and use it in GitHub Desktop.
docker-register.service
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
# I was hoping that marking this service global would allow me to start it with: | |
# | |
# fleetctl load docker-register.service | |
# | |
# Instead, I had to go onto each CoreOS host and do: | |
# | |
# cp docker-register.service /etc/systemd/system/ | |
# systemctl enable docker-register.service | |
# systemctl start docker-register.service | |
# | |
[Unit] | |
Description=Register docker containers into etcd | |
After=etcd.service | |
After=docker.service | |
Requires=etcd.service | |
Requires=docker.service | |
[Service] | |
TimeoutStartSec=0 | |
EnvironmentFile=/etc/environment | |
ExecStartPre=-/usr/bin/docker kill %n | |
ExecStartPre=-/usr/bin/docker rm %n | |
ExecStartPre=-/usr/bin/docker pull jwilder/docker-register | |
ExecStart=/usr/bin/docker run --rm --name %n -e HOST_IP=${COREOS_PUBLIC_IPV4} -e ETCD_HOST=${COREOS_PUBLIC_IPV4}:4001 -v /var/run/docker.sock:/var/run/docker.sock jwilder/docker-register | |
ExecStop=/usr/bin/docker stop %n | |
[Install] | |
WantedBy=multi-user.target | |
[X-Fleet] | |
Global=true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment