driver/docker: use default network mode
fallback to docker default network mode instead of explicit bridge for linux or nat for windows
This commit is contained in:
parent
34deb47a8b
commit
1e6ea0af8c
|
@ -882,8 +882,8 @@ func (d *Driver) createContainerConfig(task *drivers.TaskConfig, driverConfig *T
|
||||||
hostConfig.NetworkMode = netMode
|
hostConfig.NetworkMode = netMode
|
||||||
} else {
|
} else {
|
||||||
// docker default
|
// docker default
|
||||||
logger.Debug("networking mode not specified; using default", "network_mode", defaultNetworkMode)
|
logger.Debug("networking mode not specified; using default")
|
||||||
hostConfig.NetworkMode = defaultNetworkMode
|
hostConfig.NetworkMode = "default"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,6 @@ import (
|
||||||
"github.com/moby/moby/daemon/caps"
|
"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 {
|
func getPortBinding(ip string, port string) []docker.PortBinding {
|
||||||
return []docker.PortBinding{{HostIP: ip, HostPort: port}}
|
return []docker.PortBinding{{HostIP: ip, HostPort: port}}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,11 +2,6 @@ package docker
|
||||||
|
|
||||||
import docker "github.com/fsouza/go-dockerclient"
|
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.
|
//Currently Windows containers don't support host ip in port binding.
|
||||||
func getPortBinding(ip string, port string) []docker.PortBinding {
|
func getPortBinding(ip string, port string) []docker.PortBinding {
|
||||||
return []docker.PortBinding{{HostIP: "", HostPort: port}}
|
return []docker.PortBinding{{HostIP: "", HostPort: port}}
|
||||||
|
|
Loading…
Reference in a new issue