Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
fix(registry): wait for port to become available in ExecPostStart
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Monroy authored and Matthew Fisher committed Apr 15, 2014
1 parent 71fb3e6 commit b8df76a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion registry/systemd/deis-registry.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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/data"
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}') && until cat </dev/null>/dev/tcp/$HOST_IP/5000; do sleep 1; done"
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"
ExecStop=/usr/bin/docker rm -f deis-registry

[Install]
Expand Down

0 comments on commit b8df76a

Please sign in to comment.