How do you troubleshoot networking in a container without `ping`/`curl`?
IntermediateConceptNetworking
Answer
Attach a debug container to the target's network namespace:
docker run --rm -it --network container:web nicolaka/netshoot
docker run --rm -it --network container:web --pid container:web busybox sh
Or use nsenter -t <pid> -n from the host with host tools like ss, tcpdump.
More on Networking
What network drivers does Docker have?BeginnerHow does the default bridge network work?AdvancedDefault bridge vs user-defined bridge: what is the difference?IntermediateHow does container DNS work?IntermediateHow does `-p 8080:80` work under the hood?AdvancedWhat is the difference between `-p 80:80` and `-p 127.0.0.1:80:80`?Beginner