[proxy] respect custom DOCKER_BRIDGE
This commit is contained in:
1 parent
6386c1bd18
commit
acd8bdec21
2 files changed
+9
-1
No files matched your search
+8
-1
@@ -6,6 +6,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
@@ -22,7 +23,13 @@ func callWeave(args ...string) ([]byte, error) {
|
|||||||
args = append([]string{"--local"}, args...)
|
args = append([]string{"--local"}, args...)
|
||||||
Debug.Print("Calling weave", args)
|
Debug.Print("Calling weave", args)
|
||||||
cmd := exec.Command("./weave", args...)
|
cmd := exec.Command("./weave", args...)
|
||||||
cmd.Env = []string{"PROCFS=/hostproc", "PATH=/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}
|
cmd.Env = []string{
|
||||||
|
"PATH=/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
||||||
|
"PROCFS=/hostproc",
|
||||||
|
}
|
||||||
|
if bridge := os.Getenv("DOCKER_BRIDGE"); bridge != "" {
|
||||||
|
cmd.Env = append(cmd.Env, fmt.Sprintf("DOCKER_BRIDGE=%s", bridge))
|
||||||
|
}
|
||||||
out, err := cmd.CombinedOutput()
|
out, err := cmd.CombinedOutput()
|
||||||
return out, err
|
return out, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1076,6 +1076,7 @@ case "$COMMAND" in
|
|||||||
-v /proc:/hostproc \
|
-v /proc:/hostproc \
|
||||||
-e PROCFS=/hostproc \
|
-e PROCFS=/hostproc \
|
||||||
-e WEAVE_CIDR=none \
|
-e WEAVE_CIDR=none \
|
||||||
|
-e DOCKER_BRIDGE \
|
||||||
--entrypoint=/home/weave/weaveproxy \
|
--entrypoint=/home/weave/weaveproxy \
|
||||||
$WEAVEPROXY_DOCKER_ARGS $EXEC_IMAGE $PROXY_ARGS)
|
$WEAVEPROXY_DOCKER_ARGS $EXEC_IMAGE $PROXY_ARGS)
|
||||||
wait_for_log $PROXY_CONTAINER_NAME "proxy listening"
|
wait_for_log $PROXY_CONTAINER_NAME "proxy listening"
|
||||||
|
|||||||
Reference in new issue
Block a user