question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Forwarded port cannot be re-used by another container

See original GitHub issue

I experienced similar problem. I started nginx container with nerdctl run -p 8080:80 nginx . It worked as expected then I press ctr-c, container stopped. When I tried to start the container again with the same command it was not working. The container started but the port was not exported / published (I checked also with netstat).

This problem disappear after restart of the rancher desktop. Then again I was able to start the nginx and it was reachable, but again when I ctr-c it stopped working again. When I changed the Container Runtime to dockerd and used ‘docker’ instead of ‘nerdctl’ everything worked as expected.

My Info: I’m on Mac Apple M1 Pro Rancher desktop 1.0.0. Kubernetes 1.23, 1.22 Container Runtime: containerd

_Originally posted by @martinjankovic in https://github.com/rancher-sandbox/rancher-desktop/issues/1411#issuecomment-1025463841_

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
janduboiscommented, May 20, 2022

Re-opening, since the issue has been reported with 1.3.0 now.

I’m also wondering why I considered #1411 as a different problem; should be re-examined as well.

0reactions
T4ylancommented, Nov 25, 2022

Another maybe not so hard workaround (like resetting kubernetes) is, just to delete stopped containers:

nerdctl container ls -a # get the container id
nerdctl container rm <CONTAINER ID>
Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I forward a port from one docker container to another?
In my case I want to forward a local port from one container, to another. Let's say I run a service on container...
Read more >
Port Forwarding | Skaffold
Skaffold enables certain classes of forwards by default depending on the Skaffold command used. These defaults can be overridden with the --port ......
Read more >
Set Up Port Forwarding on Your Xfinity Gateway
This article explains how to set up port forwarding for your home network. You also have the option to enable port triggering on...
Read more >
How To Set Up Port Forwarding - Port Forward
You can find the Port Checker tool in our Network Utilities software. Other types of port checks done through a web browser are...
Read more >
Using Kubectl Port-Forward to Access Kubernetes Applications
In this post, you learned what port-forwarding is and how it fits into NAT. More importantly, this post covered how port forwarding can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found