Sign inSign up

zachbg/docker-debug

By zachbg

•Updated 6 months ago

40+ diagnostic tools (curl, dig, tcpdump, strace, nmap, jq) for Docker debugging

Image
1

2.8K

zachbg/docker-debug repository overview

⁠Docker Debug

All-in-one debugging toolkit for Docker containers. 40+ diagnostic tools in one image for when your production container has no shell, no curl, no nothing.

⁠Why?

Your production container is distroless. It has no shell. A service is timing out and you can't even curl to test. You need dig to debug DNS, tcpdump to capture traffic, strace to trace syscalls — none of it is installed. Docker-debug gives you everything.

⁠Quick Start

⁠Jump into a debug shell on any network
docker run -it --rm --network myapp_default zachbg/docker-debug:latest
⁠Debug a specific container's network
docker run -it --rm --network container:myapp-web-1 zachbg/docker-debug:latest
⁠Debug with host PID namespace
docker run -it --rm --pid host zachbg/docker-debug:latest

⁠Built-in Commands

debug shell              # Interactive shell with all tools
debug net                # Show network info (interfaces, routes, DNS)
debug net myhost         # Full network diagnostics for a host
debug dns example.com    # All DNS records
debug http https://api   # HTTP timing + headers
debug port db:5432       # Test port connectivity
debug certs example.com  # TLS certificate details
debug headers https://   # HTTP response headers
debug env                # All environment variables

⁠Included Tools

CategoryTools
HTTPcurl, wget, grpcurl
DNSdig, nslookup, host
Networkping, traceroute, nmap, netcat, socat, ss, ip
Capturetcpdump, ngrep
Processhtop, lsof, strace, ltrace, ps, procps
Datajq, yq, vim, less
TLSopenssl
Dockerdocker CLI
Databaseredis-cli
Systemfile, tree, iptables, conntrack

⁠Examples

⁠Debug DNS resolution between containers
docker run -it --rm --network myapp_default zachbg/docker-debug:latest \
  debug dns postgres
⁠Capture traffic on a container's network
docker run -it --rm --network container:myapp-api-1 zachbg/docker-debug:latest \
  tcpdump -i any -n port 8080
⁠Test database connectivity
docker run -it --rm --network myapp_default zachbg/docker-debug:latest \
  debug port postgres:5432
⁠Check TLS certificates
docker run --rm zachbg/docker-debug:latest debug certs api.example.com
⁠HTTP timing breakdown
docker run --rm zachbg/docker-debug:latest debug http https://api.example.com/health
⁠Redis debugging
docker run -it --rm --network myapp_default zachbg/docker-debug:latest \
  redis-cli -h redis PING

⁠Docker Compose

services:
  debug:
    image: zachbg/docker-debug:latest
    network_mode: "service:webapp"
    stdin_open: true
    tty: true
    profiles: ["debug"]  # Only start manually

# Usage: docker compose --profile debug run debug

Tag summary

Content type

Image

Digest

sha256:9a2865939…

Size

43.6 MB

Last updated

6 months ago

docker pull zachbg/docker-debug