mirror of https://github.com/docker/docs.git
Daemon: Restore network settings at startup.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
a487593729
commit
f1087c5fcf
|
@ -367,6 +367,16 @@ func (daemon *Daemon) restore() error {
|
||||||
registeredContainers = append(registeredContainers, container)
|
registeredContainers = append(registeredContainers, container)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Restore networking of registered containers.
|
||||||
|
// This must be performed prior to any IP allocation, otherwise we might
|
||||||
|
// end up giving away an already allocated address.
|
||||||
|
for _, container := range registeredContainers {
|
||||||
|
if err := container.RestoreNetwork(); err != nil {
|
||||||
|
log.Errorf("Failed to restore network for %v: %v", container.Name, err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// check the restart policy on the containers and restart any container with
|
// check the restart policy on the containers and restart any container with
|
||||||
// the restart policy of "always"
|
// the restart policy of "always"
|
||||||
if daemon.config.AutoRestart {
|
if daemon.config.AutoRestart {
|
||||||
|
|
Loading…
Reference in New Issue