Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bf2b8ec

Browse files
committed
Make daemon to start with no userlandproxy by default
This PR makes a user visible behavior change with userland proxy disabled by default and rely on hairpin NAT to be enabled by default. This may not work in older (unsupported) kernels where the user will be forced to enable userlandproxy if needed. - Updated the Docs - Changed the integration-cli to start with userlandproxy desiabled by default. Signed-off-by: Jana Radhakrishnan <[email protected]>
1 parent bc48194 commit bf2b8ec

7 files changed

Lines changed: 6 additions & 7 deletions

File tree

daemon/config_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (config *Config) InstallFlags(cmd *flag.FlagSet, usageFn func(string) strin
7474
cmd.Var(opts.NewIPOpt(&config.Bridge.DefaultGatewayIPv6, ""), []string{"-default-gateway-v6"}, usageFn("Container default gateway IPv6 address"))
7575
cmd.BoolVar(&config.Bridge.InterContainerCommunication, []string{"#icc", "-icc"}, true, usageFn("Enable inter-container communication"))
7676
cmd.Var(opts.NewIPOpt(&config.Bridge.DefaultIP, "0.0.0.0"), []string{"#ip", "-ip"}, usageFn("Default IP when binding container ports"))
77-
cmd.BoolVar(&config.Bridge.EnableUserlandProxy, []string{"-userland-proxy"}, true, usageFn("Use userland proxy for loopback traffic"))
77+
cmd.BoolVar(&config.Bridge.EnableUserlandProxy, []string{"-userland-proxy"}, false, usageFn("Use userland proxy for loopback traffic"))
7878
cmd.BoolVar(&config.EnableCors, []string{"#api-enable-cors", "#-api-enable-cors"}, false, usageFn("Enable CORS headers in the remote API, this is deprecated by --api-cors-header"))
7979
cmd.StringVar(&config.CorsHeaders, []string{"-api-cors-header"}, "", usageFn("Set CORS headers in the remote API"))
8080

docs/articles/networking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ editing this setting.
471471
> container. In such conflicting situation, Docker created iptables rules will
472472
> take precedence and route to the container.
473473
474-
The `--userland-proxy` parameter, true by default, provides a userland
474+
The `--userland-proxy` parameter, false by default, provides a userland
475475
implementation for inter-container and outside-to-container communication. When
476476
disabled, Docker uses both an additional `MASQUERADE` iptable rule and the
477477
`net.ipv4.route_localnet` kernel parameter which allow the host machine to

docs/reference/commandline/daemon.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ weight=1
5656
--tlscert="~/.docker/cert.pem" Path to TLS certificate file
5757
--tlskey="~/.docker/key.pem" Path to TLS key file
5858
--tlsverify=false Use TLS and verify the remote
59-
--userland-proxy=true Use userland proxy for loopback traffic
59+
--userland-proxy=false Use userland proxy for loopback traffic
6060

6161
Options with [] may be specified multiple times.
6262

hack/make/.integration-daemon-start

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ exec 41>&1 42>&2
1414

1515
export DOCKER_GRAPHDRIVER=${DOCKER_GRAPHDRIVER:-vfs}
1616
export DOCKER_EXECDRIVER=${DOCKER_EXECDRIVER:-native}
17-
export DOCKER_USERLANDPROXY=${DOCKER_USERLANDPROXY:-true}
17+
export DOCKER_USERLANDPROXY=${DOCKER_USERLANDPROXY:-false}
1818

1919
# example usage: DOCKER_STORAGE_OPTS="dm.basesize=20G,dm.loopdatasize=200G"
2020
storage_params=""

integration-cli/docker_cli_daemon_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,6 @@ func (s *DockerDaemonSuite) TestDaemonIP(c *check.C) {
860860
out, err := d.Cmd("run", "-d", "-p", "8000:8000", "busybox", "top")
861861
c.Assert(err, check.NotNil,
862862
check.Commentf("Running a container must fail with an invalid --ip option"))
863-
c.Assert(strings.Contains(out, "Error starting userland proxy"), check.Equals, true)
864863

865864
ifName := "dummy"
866865
out, err = createInterface(c, "dummy", ifName, ipStr)

integration-cli/docker_utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func NewDaemon(c *check.C) *Daemon {
6969
c.Fatalf("Could not create %s/graph directory", daemonFolder)
7070
}
7171

72-
userlandProxy := true
72+
userlandProxy := false
7373
if env := os.Getenv("DOCKER_USERLANDPROXY"); env != "" {
7474
if val, err := strconv.ParseBool(env); err != nil {
7575
userlandProxy = val

man/docker.1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ unix://[/path/to/socket] to use.
161161
Default is false.
162162

163163
**--userland-proxy**=*true*|*false*
164-
Rely on a userland proxy implementation for inter-container and outside-to-container loopback communications. Default is true.
164+
Rely on a userland proxy implementation for inter-container and outside-to-container loopback communications. Default is false.
165165

166166
**-v**, **--version**=*true*|*false*
167167
Print version information and quit. Default is false.

0 commit comments

Comments
 (0)