From f2a3edeed8cfd5cb51663660cd587983002a288a Mon Sep 17 00:00:00 2001 From: Amir Yalon Date: Wed, 3 Jun 2015 11:25:15 +0300 Subject: [PATCH] Detect and use the DOCKER_HOST environment variable For working with docker-machine, for example. --- launcher | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/launcher b/launcher index 2776e68..02ed96b 100755 --- a/launcher +++ b/launcher @@ -33,7 +33,9 @@ else attach_on_run="-d" fi -if [ -x "$(which ip 2>/dev/null)" ]; then +if [ -n "$DOCKER_HOST" ]; then + docker_ip=`sed -e 's/^tcp:\/\/\(.*\):.*$/\1/' <<< "$DOCKER_HOST"` +elif [ -x "$(which ip 2>/dev/null)" ]; then docker_ip=`ip addr show docker0 | \ grep 'inet ' | \ awk '{ split($2,a,"/"); print a[1] }';` -- 2.25.1