-
Notifications
You must be signed in to change notification settings - Fork 770
Closed
Labels
Description
Description
Currently <nerdctl|docker|podman> run -p 0.0.0.0:80:80 does not listen the port on host 0.0.0.0, because hostIP: "127.0.0.1" is hardcoded:
lima/pkg/limayaml/default.yaml
Lines 218 to 222 in 71861bc
| # # Lima internally appends this fallback rule at the end: | |
| # - guestIP: "127.0.0.1" | |
| # guestPortRange: [1, 65535] | |
| # hostIP: "127.0.0.1" | |
| # hostPortRange: [1, 65535] |
We should probably use 0.0.0.0 when the guest uses 0.0.0.0.
The guest agent is already aware of "0.0.0.0" IP.
lima/pkg/guestagent/api/api.go
Lines 13 to 28 in 71861bc
| type IPPort struct { | |
| IP net.IP `json:"ip"` | |
| Port int `json:"port"` | |
| } | |
| func (x *IPPort) String() string { | |
| return net.JoinHostPort(x.IP.String(), strconv.Itoa(x.Port)) | |
| } | |
| type Info struct { | |
| // LocalPorts contain 127.0.0.1 and 0.0.0.0. | |
| // LocalPorts do NOT contain addresses such as 127.0.0.53 and 192.168.5.15. | |
| // | |
| // In future, LocalPorts will contain IPv6 addresses (::1 and ::) as well. | |
| LocalPorts []IPPort `json:"localPorts"` | |
| } |
Background:
cc @abiosoft
abiosoft