Skip to content

Instantly share code, notes, and snippets.

@andyshinn
Created February 14, 2015 01:23
Show Gist options
  • Select an option

  • Save andyshinn/698f372843feb9404f4c to your computer and use it in GitHub Desktop.

Select an option

Save andyshinn/698f372843feb9404f4c to your computer and use it in GitHub Desktop.
Example registrator systemd unit
[Unit]
Description=registrator
Documentation=https://github.com/progrium/registrator
X-Image=progrium/registrator
[Service]
EnvironmentFile=/etc/environment
ExecStart=/bin/sh -c "docker run \
--name %p-%i \
-v /var/run/docker.sock:/tmp/docker.sock \
progrium/registrator \
-ttl 180 \
-ttl-refresh 120 \
-ip $COREOS_PRIVATE_IPV4 \
etcd://$COREOS_PRIVATE_IPV4:4001/firehose/services"
ExecStop=/usr/bin/docker rm -f %p-%i
TimeoutStartSec=30s
TimeoutStopSec=30s
RestartSec=30s
Restart=on-failure
[X-Fleet]
X-Conflicts=%p@*.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment