podman-desktop
podman-desktop copied to clipboard
Detection of port already in use fails
Bug description
Steps to reproduce:
-
On Podman Desktop, go to the Images page
-
choose an image (for example nginx), and select the icon > (Create a container from image)
-
look at port mapping, it should be 9000
-
Start Container
-
Container should be running
-
choose the same image, and select again > (Create a container from image)
-
look at the port mapping, it should be 9001
On Mac, the port displayed is still 9000.
Debugging the code, I have seen that https://github.com/containers/podman-desktop/blob/main/packages/main/src/plugin/util/port.ts#L64C19-L64C20 tries to listen on 127.0.0.1:port, and on my system the detection fails. If I change to 0.0.0.0:port, the detection works correctly.
Operating system
mac m3 (Sonoma 14.3 (23D56))
Installation Method
None
Version
next (development version)
Steps to reproduce
No response
Relevant log output
No response
Additional context
No response
Was able to reproduce this issue on M1 Pro with 100% repro rate, the port does not increment even though there is an active container already running.