浏览代码

Merge pull request #1147 from pyakpyak/master

don't add /etc/hosts record if container's ip is empty (--net=none)
Santhosh Manohar 9 年之前
父节点
当前提交
f1780a1fd9
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      libnetwork/sandbox_dns_unix.go

+ 4 - 0
libnetwork/sandbox_dns_unix.go

@@ -90,6 +90,10 @@ func (sb *sandbox) buildHostsFile() error {
 func (sb *sandbox) updateHostsFile(ifaceIP string) error {
 	var mhost string
 
+	if ifaceIP == "" {
+		return nil
+	}
+
 	if sb.config.originHostsPath != "" {
 		return nil
 	}