Skip to content

Commit

Permalink
driver/docker: use default network mode
Browse files Browse the repository at this point in the history
fallback to docker default network mode instead of explicit bridge for linux
or nat for windows
  • Loading branch information
ilyaiqoqo committed Jul 31, 2019
1 parent 3fef983 commit d4919ce
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
4 changes: 2 additions & 2 deletions drivers/docker/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,8 @@ func (d *Driver) createContainerConfig(task *drivers.TaskConfig, driverConfig *T
hostConfig.NetworkMode = netMode
} else {
// docker default
logger.Debug("networking mode not specified; using default", "network_mode", defaultNetworkMode)
hostConfig.NetworkMode = defaultNetworkMode
logger.Debug("networking mode not specified; using default")
hostConfig.NetworkMode = "default"
}
}

Expand Down
5 changes: 0 additions & 5 deletions drivers/docker/driver_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ import (
"github.com/moby/moby/daemon/caps"
)

const (
// Setting default network mode for non-windows OS as bridge
defaultNetworkMode = "bridge"
)

func getPortBinding(ip string, port string) []docker.PortBinding {
return []docker.PortBinding{{HostIP: ip, HostPort: port}}
}
Expand Down
5 changes: 0 additions & 5 deletions drivers/docker/driver_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ package docker

import docker "github.com/fsouza/go-dockerclient"

const (
// Default network mode for windows containers is nat
defaultNetworkMode = "nat"
)

//Currently Windows containers don't support host ip in port binding.
func getPortBinding(ip string, port string) []docker.PortBinding {
return []docker.PortBinding{{HostIP: "", HostPort: port}}
Expand Down

0 comments on commit d4919ce

Please sign in to comment.