Skip to content

Commit 5077e33

Browse files
committed
Incorporate empty HostIP podman edge case
As discovered by @richvdh Spawning from - #779 (comment) - #779 (comment)
1 parent cdeb5ec commit 5077e33

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/docker/builder.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,13 @@ func findPortBinding(p nat.PortMap, hsPortBindingIP string, port int) (portBindi
581581
HostIP: hsPortBindingIP,
582582
HostPort: pb.HostPort,
583583
}, nil
584+
} else if pb.HostIP == "" && hsPortBindingIP == "127.0.0.1" {
585+
// `HostIP` can be empty in certain environments (observed with podman v4.3.1). We
586+
// will assume this is only a binding for `127.0.0.1`.
587+
return nat.PortBinding{
588+
HostIP: hsPortBindingIP,
589+
HostPort: pb.HostPort,
590+
}, nil
584591
}
585592
}
586593

0 commit comments

Comments
 (0)