`docker run -p 8080:80 myapp` starts fine, but `curl localhost:8080` returns `Connection reset by peer`.
BeginnerTroubleshootingContainers, Kubernetes, IPv6 and packet captures
Answer
Likely causes → Docker's port mapping accepts the connection, but inside the container nothing listens on 0.0.0.0:80: the app listens on 127.0.0.1 (only reachable from inside the container) or on a different port (e.g. 3000).
Diagnose →
docker exec myapp ss -ltn # or: docker exec myapp netstat -ltn
docker logs myapp | grep -i listen
docker port myapp
Fix → Bind the app to 0.0.0.0 (Flask --host=0.0.0.0, Vite --host, Rails -b 0.0.0.0) and map the right container port (-p 8080:3000).
Prevent → EXPOSE the correct port in the Dockerfile and add a HEALTHCHECK that hits it.
More on Containers, Kubernetes, IPv6 and packet captures
After someone ran `iptables -F` (or restarted firewalld), all Docker containers lost outbound connectivity.IntermediateTwo containers on the default bridge network can't reach each other by container name.Beginner`docker run -p 80:80 nginx` fails with `Bind for 0.0.0.0:80 failed: port is already allocated`.BeginnerA new Kubernetes node stays `NotReady` with `container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initialized`.IntermediateA Service returns `Connection refused` / nothing, and `kubectl get endpoints myapp` shows `<none>`.Beginner`curl` to a pod IP works, but `curl` to the Service's ClusterIP times out.Intermediate