Compose Networking Debug
Diagnose and fix networking issues between Docker Compose services including DNS resolution, port conflicts, and connectivity problems.
Prerequisites
- -Docker Compose installed
- -A running Compose stack
Steps
List Compose networks
See which networks the Compose stack created.
Inspect a network to see connected containers
View detailed info about a network including which containers are attached and their IP addresses.
Test DNS resolution between services
Verify that service discovery works by resolving a service name from within another container.
In Compose, services can reach each other by service name. If DNS fails, check that both services are on the same network.
Test connectivity between services
Verify that one service can actually reach another on the expected port.
If nc is not available, try: wget -qO- --spider http://db:5432 or install it with apk add netcat-openbsd.
Debug with netshoot on the Compose network
Attach a full networking toolkit to the Compose network for advanced debugging.
Full Script
FAQ
Discussion
Loading comments...