浏览代码

Merge pull request #3515 from crosbymichael/no-host-name-without-networking

Do not add hostname when networking is disabled
Guillaume J. Charmes 11 年之前
父节点
当前提交
42df36b6fc
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      container.go

+ 1 - 1
container.go

@@ -1044,7 +1044,7 @@ ff02::2		ip6-allrouters
 
 	if container.Config.Domainname != "" {
 		hostsContent = append([]byte(fmt.Sprintf("%s\t%s.%s %s\n", IP, container.Config.Hostname, container.Config.Domainname, container.Config.Hostname)), hostsContent...)
-	} else {
+	} else if !container.Config.NetworkDisabled {
 		hostsContent = append([]byte(fmt.Sprintf("%s\t%s\n", IP, container.Config.Hostname)), hostsContent...)
 	}