Browse Source

Merge pull request #1434 from docker/PortBindings

set PortBinding HostIP
Guillaume Tardif 4 years ago
parent
commit
3f502000e2
1 changed files with 3 additions and 1 deletions
  1. 3 1
      local/compose/create.go

+ 3 - 1
local/compose/create.go

@@ -366,7 +366,9 @@ func buildContainerPortBindingOptions(s types.ServiceConfig) nat.PortMap {
 	for _, port := range s.Ports {
 		p := nat.Port(fmt.Sprintf("%d/%s", port.Target, port.Protocol))
 		bind := []nat.PortBinding{}
-		binding := nat.PortBinding{}
+		binding := nat.PortBinding{
+			HostIP: port.HostIP,
+		}
 		if port.Published > 0 {
 			binding.HostPort = fmt.Sprint(port.Published)
 		}