From 800f4663b676b64c9e7f27e52d6a7cc299ac97a6 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Tue, 22 Dec 2015 14:11:03 +0000 Subject: [PATCH 1/3] Only pass through $DOCKER_HOST in exec_remote() if it is a Unix socket; a TCP socket may be secured by TLS, in which case we can't use it. --- weave | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/weave b/weave index c5bfa414..0b1d1e84 100755 --- a/weave +++ b/weave @@ -95,18 +95,19 @@ usage() { exit 1 } -docker_sock_volume_mount() { - if [ -z "$DOCKER_HOST" ]; then - DOCKER_SOCK="/var/run/docker.sock" - elif echo "$DOCKER_HOST" | grep -q "^unix://" >/dev/null; then - DOCKER_SOCK="${DOCKER_HOST#unix://}" - fi - [ -z "$DOCKER_SOCK" ] || echo "-v $DOCKER_SOCK:$DOCKER_SOCK" +docker_sock_options() { + # Pass through DOCKER_HOST if it is a Unix socket; + # a TCP socket may be secured by TLS, in which case we can't use it + if echo "$DOCKER_HOST" | grep -q "^unix://" >/dev/null; then + echo "-v ${DOCKER_HOST#unix://}:${DOCKER_HOST#unix://} -e DOCKER_HOST" + else + echo "-v /var/run/docker.sock:/var/run/docker.sock" + fi } exec_remote() { docker $DOCKER_CLIENT_ARGS run --rm --privileged --net=host \ - $(docker_sock_volume_mount) \ + $(docker_sock_options) \ -v /proc:/hostproc \ -e PROCFS=/hostproc \ -e DOCKERHUB_USER="$DOCKERHUB_USER" \ @@ -121,7 +122,6 @@ exec_remote() { -e WEAVE_NO_FASTDP \ -e WEAVE_NO_BRIDGED_FASTDP \ -e WEAVE_NO_PLUGIN \ - -e DOCKER_HOST \ -e DOCKER_BRIDGE \ -e DOCKER_CLIENT_HOST="$DOCKER_CLIENT_HOST" \ -e DOCKER_CLIENT_ARGS \ @@ -1615,10 +1615,9 @@ launch_router() { # additional parameters, such as resource limits, to docker # when launching the weave container. ROUTER_CONTAINER=$(docker run --privileged -d --name=$CONTAINER_NAME \ - $(docker_sock_volume_mount) \ + $(docker_sock_options) \ -p $PORT:$CONTAINER_PORT/tcp -p $PORT:$CONTAINER_PORT/udp \ ${NETHOST_OPT:-$DNS_PORT_MAPPING} \ - -e DOCKER_HOST \ -e WEAVE_PASSWORD \ -e WEAVE_CIDR=none \ $WEAVE_DOCKER_ARGS $IMAGE $COVERAGE_ARGS \ @@ -1673,12 +1672,11 @@ launch_proxy() { mkdir -p /var/run/weave PROXY_CONTAINER=$(docker run --privileged -d --name=$PROXY_CONTAINER_NAME --net=host \ $PROXY_VOLUMES \ - $(docker_sock_volume_mount) \ + $(docker_sock_options) \ -v /var/run/weave:/var/run/weave \ -v /proc:/hostproc \ -e PROCFS=/hostproc \ -e WEAVE_CIDR=none \ - -e DOCKER_HOST \ -e DOCKER_BRIDGE \ -e WEAVE_DEBUG \ -e COVERAGE \ @@ -1697,9 +1695,8 @@ launch_plugin() { PLUGIN_CONTAINER=$(docker run --privileged -d --name=$PLUGIN_CONTAINER_NAME \ --restart=always \ --net=host \ - $(docker_sock_volume_mount) \ + $(docker_sock_options) \ -v /run/docker/plugins:/run/docker/plugins \ - -e DOCKER_HOST \ $PLUGIN_IMAGE "$@") } From bab758ebf98282cdce6c5b615a17acca53f0aa8e Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Tue, 22 Dec 2015 14:12:16 +0000 Subject: [PATCH 2/3] Revert "Launch the proxy via unix socket in last test" - since we won't now be copying $DOCKER_HOST This reverts commit d8cfbc4e0800a29bafadf2df9776186eb4ed5e4d. --- test/650_proxy_env_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/650_proxy_env_test.sh b/test/650_proxy_env_test.sh index bfcbbe46..345f661e 100755 --- a/test/650_proxy_env_test.sh +++ b/test/650_proxy_env_test.sh @@ -30,7 +30,7 @@ check # Check we can use weave env/config with unix -Hs specified weave_on $HOST1 stop -run_on $HOST1 "COVERAGE=$COVERAGE weave launch-proxy -H unix:///var/run/weave/weave.sock" +weave_on $HOST1 launch-proxy -H unix:///var/run/weave/weave.sock assert_raises "run_on $HOST1 'eval \$(weave env) ; docker $CMD'" assert_raises "run_on $HOST1 'docker \$(weave config) $CMD'" From ba266ef8d37de1446bb1b903a962845b57aff9a1 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Tue, 22 Dec 2015 17:17:52 +0000 Subject: [PATCH 3/3] Add release v1.4.1 --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1c3a8a2..98519994 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## Release 1.4.1 + +This is a bug-fix release to cover a few issues that came up since the +release of 1.4.0. + +* Weave would fail to launch when `$DOCKER_HOST` was set to a TCP socket secured with TLS #1820/#1822 +* Weave would fail to stop when run against Docker pre-1.9 #1815/#1817 +* Issue a warning instead of failing on `--with-dns` option to proxy, which was removed #1810/#1812 +* Make `weave version` show the plugin version #1797/#1813 +* Make `weave launch` show when the a container is restarting #1778/#1814 +* Make `weave launch` fail if the plugin is running, for consistency with router and proxy. #1818/#1819 + +More details in the [change log](https://github.com/weaveworks/weave/issues?q=milestone%3A1.4.1). + ## Release 1.4.0 **Highlights**