-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathdeis-registry.service
More file actions
13 lines (11 loc) · 1.06 KB
/
deis-registry.service
File metadata and controls
13 lines (11 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
[Unit]
Description=deis-registry
[Service]
TimeoutStartSec=20m
ExecStartPre=/bin/sh -c "/usr/bin/docker history deis/registry >/dev/null || /usr/bin/docker pull deis/registry"
ExecStartPre=/bin/bash -c "/usr/bin/docker start deis-registry-data || /usr/bin/docker run --name deis-registry-data -v /data deis/base /bin/true"
ExecStart=/bin/sh -c "IFACE=$(netstat -nr | grep ^0.0.0.0 | awk '{print $8}') && HOST_IP=$(/bin/ifconfig $IFACE | awk '/inet /{print $2}') && exec /usr/bin/docker run --name deis-registry -p 5000:5000 -e PUBLISH=5000 -e HOST=$HOST_IP --volumes-from deis-registry-data deis/registry"
ExecStartPost=/bin/sh -c "IFACE=$(netstat -nr | grep ^0.0.0.0 | awk '{print $8}') && HOST_IP=$(/bin/ifconfig $IFACE | awk '/inet /{print $2}') && echo 'Waiting for listener on 5000/tcp...' && until cat </dev/null>/dev/tcp/$HOST_IP/5000; do sleep 1; done && docker pull deis/slugrunner:latest && docker tag deis/slugrunner $HOST_IP:5000/deis/slugrunner && docker push $HOST_IP:5000/deis/slugrunner"
ExecStop=/usr/bin/docker rm -f deis-registry
[Install]
WantedBy=multi-user.target