From 26eea6eab26f0f9ec8cd6036534c8e49dc605209 Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Thu, 27 Aug 2015 16:43:14 +0100 Subject: [PATCH 1/2] Works with boot2docker. The DOCKER_BRIDGE_IP is set on the remote host, so it will be found correctly on boot2docker. --- scope | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scope b/scope index 74da235e9..3aec62fc5 100755 --- a/scope +++ b/scope @@ -99,7 +99,7 @@ weave_dns_present() { } set_docker_bridge_ip() { - DOCKER_BRIDGE_IP=$(ip -4 addr show dev $DOCKER_BRIDGE | grep -m1 -o 'inet [.0-9]*') + DOCKER_BRIDGE_IP=$(docker run --rm --net=host --entrypoint /bin/sh $SCOPE_IMAGE -c "ip -f inet address show dev $DOCKER_BRIDGE" | grep -m1 -o 'inet \([.0-9]\)*') DOCKER_BRIDGE_IP=${DOCKER_BRIDGE_IP#inet } } From 235cbd3a526a1fc25e12e4a63f40c03aae9c2d48 Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Fri, 28 Aug 2015 11:59:29 +0100 Subject: [PATCH 2/2] use weavescope image for all remote work, so they're labelled works.weave.role=system --- scope | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scope b/scope index 3aec62fc5..a973f2333 100755 --- a/scope +++ b/scope @@ -95,7 +95,7 @@ weave_dns_add() { } weave_dns_present() { - docker run --rm gliderlabs/alpine nc -z $DOCKER_BRIDGE_IP 53 || is_running $WEAVEDNS_CONTAINER_NAME + docker run --rm --entrypoint /bin/sh $SCOPE_IMAGE -c "nc -z $DOCKER_BRIDGE_IP 53" || is_running $WEAVEDNS_CONTAINER_NAME } set_docker_bridge_ip() { @@ -168,7 +168,7 @@ case "$COMMAND" in -v /var/run/docker.sock:/var/run/docker.sock \ $WEAVESCOPE_DOCKER_ARGS $SCOPE_IMAGE $WEAVESCOPE_DNS_ARGS $SCOPE_ARGS --probe.docker true "$@") - IP_ADDRS=$(docker run --rm --net=host gliderlabs/alpine /bin/sh -c "$IP_ADDR_CMD") + IP_ADDRS=$(docker run --rm --net=host --entrypoint /bin/sh $SCOPE_IMAGE -c "$IP_ADDR_CMD") if command_exists weave && is_running $WEAVE_CONTAINER_NAME && weave_dns_present; then if [ -z "$IP_ADDRS" ]; then echo "Could not determine local IP address; Weave DNS integration will not work correctly."