From d710684f8efb4a557aa7ef116e13e1306eafeceb Mon Sep 17 00:00:00 2001 From: Michael Bridgen Date: Thu, 30 Apr 2015 12:58:36 +0100 Subject: [PATCH] Should not pass value of `$PROCFS` (close #622) This is picked from squaremo/weave@d3cc606d5b356dff59ce2ab8304d8b54b27a61b9 The environment variable `PROCFS` was originally added so that the script could be run in a container. The host's /proc is bind-mounted as /hostproc, and the script must be told this. The remote weaving changes got this a bit wrong, by using the value of `$PROCFS` in a "volume" mount argument (`-v`) to docker -- but when invoking a container, the left-hand-side of the volume mount should *always* be `/proc` (and the right-hand-side always `/hostproc`), since it will always be binding the host's `/proc` to the container's `/hostproc`. The gist is that docker looks at host's root filesystem and if you pass `-v /hostporc:/hostproc` when running from a container where you have already bind-mounted it, it will end-up creating empty directory in the target container as there is no `/hostproc` from docker's perspective. --- weave | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weave b/weave index 5ddb6abc..9b274c38 100755 --- a/weave +++ b/weave @@ -44,7 +44,7 @@ usage() { exec_remote() { docker run --rm --privileged --net=host \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v "$PROCFS":/hostproc \ + -v /proc:/hostproc \ -e PROCFS=/hostproc \ -e VERSION \ -e WEAVE_DOCKER_ARGS \