Browse code

Do not add hostname when networking is disabled

Docker-DCO-1.0-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)

Michael Crosby authored on 2014/01/09 09:57:56
Showing 1 changed files
... ...
@@ -1044,7 +1044,7 @@ ff02::2		ip6-allrouters
1044 1044
 
1045 1045
 	if container.Config.Domainname != "" {
1046 1046
 		hostsContent = append([]byte(fmt.Sprintf("%s\t%s.%s %s\n", IP, container.Config.Hostname, container.Config.Domainname, container.Config.Hostname)), hostsContent...)
1047
-	} else {
1047
+	} else if !container.Config.NetworkDisabled {
1048 1048
 		hostsContent = append([]byte(fmt.Sprintf("%s\t%s\n", IP, container.Config.Hostname)), hostsContent...)
1049 1049
 	}
1050 1050