mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
change 127.0.0.1 -> 127.0.1.1 & remove ::1 -> hostname mapping
This commit is contained in:
parent
7d95d300ab
commit
c2912c82aa
1 changed files with 1 additions and 3 deletions
|
@ -579,7 +579,7 @@ func (container *Container) Start(hostConfig *HostConfig) error {
|
||||||
}
|
}
|
||||||
if container.runtime.networkManager.disabled {
|
if container.runtime.networkManager.disabled {
|
||||||
container.Config.NetworkDisabled = true
|
container.Config.NetworkDisabled = true
|
||||||
container.buildHostnameAndHostsFiles("127.0.0.1")
|
container.buildHostnameAndHostsFiles("127.0.1.1")
|
||||||
} else {
|
} else {
|
||||||
if err := container.allocateNetwork(); err != nil {
|
if err := container.allocateNetwork(); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -886,10 +886,8 @@ ff02::2 ip6-allrouters
|
||||||
container.HostsPath = path.Join(container.root, "hosts")
|
container.HostsPath = path.Join(container.root, "hosts")
|
||||||
|
|
||||||
if container.Config.Domainname != "" {
|
if container.Config.Domainname != "" {
|
||||||
hostsContent = append([]byte(fmt.Sprintf("::1\t\t%s.%s %s\n", container.Config.Hostname, container.Config.Domainname, container.Config.Hostname)), hostsContent...)
|
|
||||||
hostsContent = append([]byte(fmt.Sprintf("%s\t%s.%s %s\n", IP, container.Config.Hostname, container.Config.Domainname, container.Config.Hostname)), hostsContent...)
|
hostsContent = append([]byte(fmt.Sprintf("%s\t%s.%s %s\n", IP, container.Config.Hostname, container.Config.Domainname, container.Config.Hostname)), hostsContent...)
|
||||||
} else {
|
} else {
|
||||||
hostsContent = append([]byte(fmt.Sprintf("::1\t\t%s\n", container.Config.Hostname)), hostsContent...)
|
|
||||||
hostsContent = append([]byte(fmt.Sprintf("%s\t%s\n", IP, container.Config.Hostname)), hostsContent...)
|
hostsContent = append([]byte(fmt.Sprintf("%s\t%s\n", IP, container.Config.Hostname)), hostsContent...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue