Support completely disabling network configuration with docker -d -b none

This commit is contained in:
Stefan Praszalowicz
2013-07-21 17:49:09 -07:00
parent 3342bdb331
commit 49673fc45c
2 changed files with 33 additions and 2 deletions
+6 -2
View File
@@ -514,8 +514,12 @@ func (container *Container) Start(hostConfig *HostConfig) error {
if err := container.EnsureMounted(); err != nil {
return err
}
if err := container.allocateNetwork(); err != nil {
return err
if container.runtime.networkManager.disabled {
container.Config.NetworkEnabled = false
} else {
if err := container.allocateNetwork(); err != nil {
return err
}
}
// Make sure the config is compatible with the current kernel