mirror of https://github.com/docker/compose.git
set PortBinding HostIP
close https://github.com/docker/compose-cli/issues/1403 Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
0108cc5727
commit
8f7e7abc6c
|
@ -366,7 +366,9 @@ func buildContainerPortBindingOptions(s types.ServiceConfig) nat.PortMap {
|
||||||
for _, port := range s.Ports {
|
for _, port := range s.Ports {
|
||||||
p := nat.Port(fmt.Sprintf("%d/%s", port.Target, port.Protocol))
|
p := nat.Port(fmt.Sprintf("%d/%s", port.Target, port.Protocol))
|
||||||
bind := []nat.PortBinding{}
|
bind := []nat.PortBinding{}
|
||||||
binding := nat.PortBinding{}
|
binding := nat.PortBinding{
|
||||||
|
HostIP: port.HostIP,
|
||||||
|
}
|
||||||
if port.Published > 0 {
|
if port.Published > 0 {
|
||||||
binding.HostPort = fmt.Sprint(port.Published)
|
binding.HostPort = fmt.Sprint(port.Published)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue