Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Conversation

errordeveloper
Copy link
Contributor

This is picked from squaremo/weave@d3cc606, hence @squaremo's authorship is preserved.

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.

@errordeveloper errordeveloper changed the title Should not pass value of $PROCFS Should not pass value of $PROCFS (close #622) Apr 30, 2015
squaremo and others added 2 commits April 30, 2015 13:49
This is picked from squaremo/weave@d3cc606

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.
It's not required to be set at the top, it's only looked at down below.
@errordeveloper errordeveloper force-pushed the fix-binding-hostproc-within-container-where-is-already-bound branch from 0c13129 to 9d0c9f1 Compare April 30, 2015 12:49
rade added a commit that referenced this pull request Apr 30, 2015
…in-container-where-is-already-bound

Should not pass value of `$PROCFS`

Fixes #622.
@rade rade merged commit 87f47a6 into weaveworks:master Apr 30, 2015
@errordeveloper errordeveloper deleted the fix-binding-hostproc-within-container-where-is-already-bound branch April 30, 2015 13:48
@rade rade modified the milestone: 0.11.0 May 12, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants