[Unit] Description=Hello World Nginx Requires=docker.service After=docker.service [Service] TimeoutStartSec=0 ExecStartPre=-/usr/bin/docker kill helloworld-nginx ExecStartPre=-/usr/bin/docker rm -f helloworld-nginx ExecStartPre=/usr/bin/docker pull mattbailey/helloworld-nginx:latest ExecStart=/bin/sh -c 'for host in `etcdctl ls /services/helloworld`; do UPSTREAM=$UPSTREAM`etcdctl get $host`; done; docker run -t -e UPSTREAM="$UPSTREAM" --name helloworld-nginx -p 80:80 mattbailey/helloworld-nginx:latest' ExecStop=-/usr/bin/docker stop helloworld-nginx