Port forwarding not working as expected
See original GitHub issueActual Behavior
Self built images don’t open ports when run with nerdctl run -p 127.0.0.1:8081:80 f2d889a1bc4c
.
Prebuilt nginx container opens up port 8080 as expected when run with nerdctl run -d -p 127.0.0.1:8080:80 nginx:alpine
.
lima.ha.stderr.log shows no error, but also shows no success unlike for nginx image which results in:
"level":"debug","msg":"guest agent event: {Time:2022-02-17 15:20:26.158725448 +0000 UTC LocalPortsAdded:[{IP:127.0.0.1 Port:8080}] LocalPortsRemoved:[] Errors:[]}","time":"2022-02-17T16:20:26+01:00"
Steps to Reproduce
Run nerdctl run -p 127.0.0.1:8081:80 f2d889a1bc4c
with an image that should react on port 80.
Try to telnet into port
Result
Connection not possible on chosen port
Expected Behavior
Connection pssible on exposed port
Additional Information
No response
Rancher Desktop Version
1.0.1
Rancher Desktop K8s Version
1.23.3
Which container runtime are you using?
containerd (nerdctl)
What operating system are you using?
macOS
Operating System / Build Version
macOS Monterey 12.01
What CPU architecture are you using?
arm64 (Apple Silicon)
Linux only: what package format did you use to install Rancher Desktop?
No response
Windows User Only
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
I the same issue; I am using Mac m1, moby/dockerd and have exposed the relevant ports in my Dockerfile and published when running but if I attempt to send anything to those ports, I get connection refused…
on the host:
on the container:
on the host:
digging further, I see the port is configured in the DOCKER iptables chain on lima…
The problem reported in the issue description seems to have been sorted out. Closing the issue. Please free to reopen if it’s still a problem.