Skip to content

Commit 1c165e3

Browse files
Gabriel MonroyMatthew Fisher
authored andcommitted
fix(systemd): lookup default gateway interface for HOST_IP
- only pull images if they don't already exist in the local docker cache
1 parent d6b3783 commit 1c165e3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

systemd/deis-controller.service

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Description=deis-controller
33

44
[Service]
55
TimeoutStartSec=20m
6-
ExecStartPre=/usr/bin/docker pull deis/controller
7-
ExecStart=/bin/sh -c "HOST_IP=$(/bin/ifconfig eth0 | awk '/inet /{print $2}') && exec /usr/bin/docker run --name deis-controller -p 8000:8000 -e PUBLISH=8000 -e HOST=$HOST_IP deis/controller"
6+
ExecStartPre=/bin/sh -c "/usr/bin/docker history deis/controller >/dev/null || /usr/bin/docker pull deis/controller"
7+
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-controller -p 8000:8000 -e PUBLISH=8000 -e HOST=$HOST_IP deis/controller"
88
ExecStop=/usr/bin/docker rm -f deis-controller
99

1010
[Install]

0 commit comments

Comments
 (0)