github.com/didip/deis@v1.4.1/deisctl/units/deis-cache.service (about) 1 [Unit] 2 Description=deis-cache 3 4 [Service] 5 EnvironmentFile=/etc/environment 6 TimeoutStartSec=20m 7 ExecStartPre=/bin/sh -c "IMAGE=`/run/deis/bin/get_image /deis/cache` && docker history $IMAGE >/dev/null || docker pull $IMAGE" 8 ExecStartPre=/bin/sh -c "docker inspect deis-cache >/dev/null && docker rm -f deis-cache || true" 9 ExecStart=/bin/sh -c "IMAGE=`/run/deis/bin/get_image /deis/cache` && docker run --name deis-cache --rm -p 6379:6379 -e EXTERNAL_PORT=6379 -e HOST=$COREOS_PRIVATE_IPV4 $IMAGE" 10 ExecStopPost=-/usr/bin/docker rm -f deis-cache 11 Restart=on-failure 12 RestartSec=5 13 14 [Install] 15 WantedBy=multi-user.target