projects
/
discourse_docker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9e83982
)
Detect and use the DOCKER_HOST environment variable
author
Amir Yalon
<git@please.nospammail.net>
Wed, 3 Jun 2015 08:25:15 +0000
(11:25 +0300)
committer
Amir Yalon
<git@please.nospammail.net>
Wed, 3 Jun 2015 08:25:15 +0000
(11:25 +0300)
For working with docker-machine, for example.
launcher
patch
|
blob
|
blame
|
history
diff --git
a/launcher
b/launcher
index 2776e686a7624e6b148ae84a8411c5631cf41505..02ed96bf58dc4f74c999775fb62b59ca1405f090 100755
(executable)
--- 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] }';`