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:
Victor Vieux 2014-06-12 19:20:57 +00:00
parent 9494643bf1
commit f5979b9d0d

View file

@ -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
} }