Move port-publishing check to linux platform-check
Windows does not have host-mode networking, so on Windows, this check was a no-op Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
57f1305e74
commit
2e23ef5350
2 changed files with 4 additions and 3 deletions
|
@ -351,8 +351,5 @@ func (daemon *Daemon) verifyContainerSettings(platform string, hostConfig *conta
|
|||
if warnings, err = verifyPlatformContainerSettings(daemon, hostConfig, config, update); err != nil {
|
||||
return warnings, err
|
||||
}
|
||||
if hostConfig.NetworkMode.IsHost() && len(hostConfig.PortBindings) > 0 {
|
||||
warnings = append(warnings, "Published ports are discarded when using host network mode")
|
||||
}
|
||||
return warnings, err
|
||||
}
|
||||
|
|
|
@ -607,6 +607,10 @@ func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes.
|
|||
warnings = append(warnings, "IPv4 forwarding is disabled. Networking will not work.")
|
||||
logrus.Warn("IPv4 forwarding is disabled. Networking will not work")
|
||||
}
|
||||
if hostConfig.NetworkMode.IsHost() && len(hostConfig.PortBindings) > 0 {
|
||||
warnings = append(warnings, "Published ports are discarded when using host network mode")
|
||||
}
|
||||
|
||||
// check for various conflicting options with user namespaces
|
||||
if daemon.configStore.RemappedRoot != "" && hostConfig.UsernsMode.IsPrivate() {
|
||||
if hostConfig.Privileged {
|
||||
|
|
Loading…
Reference in a new issue