add hostname generation with --net=host
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
This commit is contained in:
parent
9494643bf1
commit
f5979b9d0d
1 changed files with 4 additions and 1 deletions
|
@ -886,8 +886,11 @@ func (container *Container) initializeNetworking() error {
|
||||||
content, err := ioutil.ReadFile("/etc/hosts")
|
content, err := ioutil.ReadFile("/etc/hosts")
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
return container.buildHostnameAndHostsFiles("")
|
return container.buildHostnameAndHostsFiles("")
|
||||||
|
} else if err != nil {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
if err != nil {
|
|
||||||
|
if err := container.buildHostnameFile(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue