From f10c460f48eb6181a7a3133e635b5db013436f6d Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Sun, 14 Sep 2014 19:31:27 +0100 Subject: [PATCH] leave networking alone on 'weave launch' unless we start container --- weaver/weave | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/weaver/weave b/weaver/weave index 62e11d22..33f7d83e 100755 --- a/weaver/weave +++ b/weaver/weave @@ -117,15 +117,6 @@ case "$COMMAND" in [ $# -gt 0 ] || usage IPADDR=$1 shift 1 - create_bridge - setup_masquerading $IPADDR - # We set the router name to the bridge mac since that is - # stable across re-creations of the containers. - # - # TODO use the mac of one of the physical host interfaces - # (eth0, wlan0, etc) so the name becomes stable across host - # restarts. - MACADDR=`cat /sys/class/net/$BRIDGE/address` case $(docker inspect --format '{{ .State.Running }} {{ .Config.Image }}' weave 2>/dev/null) in "true zettio/weave") echo "Weave is already running." >&2 @@ -143,6 +134,15 @@ case "$COMMAND" in exit 1 ;; esac + create_bridge + setup_masquerading $IPADDR + # We set the router name to the bridge mac since that is + # stable across re-creations of the containers. + # + # TODO use the mac of one of the physical host interfaces + # (eth0, wlan0, etc) so the name becomes stable across host + # restarts. + MACADDR=`cat /sys/class/net/$BRIDGE/address` CONTAINER=$(docker run --privileged -d --name=weave -p 6783:6783/tcp -p 6783:6783/udp $WEAVE_DOCKER_ARGS zettio/weave -name $MACADDR "$@") configure_container_networking $CONTAINER $IPADDR eth0 echo $CONTAINER