From f5979b9d0dd993a00e064114218ccdbfdaab9fe0 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Thu, 12 Jun 2014 19:20:57 +0000 Subject: [PATCH] add hostname generation with --net=host Docker-DCO-1.1-Signed-off-by: Victor Vieux (github: vieux) --- daemon/container.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/daemon/container.go b/daemon/container.go index f7d2ef1f5f..239091f10b 100644 --- a/daemon/container.go +++ b/daemon/container.go @@ -886,8 +886,11 @@ func (container *Container) initializeNetworking() error { content, err := ioutil.ReadFile("/etc/hosts") if os.IsNotExist(err) { return container.buildHostnameAndHostsFiles("") + } else if err != nil { + return err } - if err != nil { + + if err := container.buildHostnameFile(); err != nil { return err }