Browse Source

add hostname generation with --net=host

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Victor Vieux 11 years ago
parent
commit
f5979b9d0d
1 changed files with 4 additions and 1 deletions
  1. 4 1
      daemon/container.go

+ 4 - 1
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
 		}