
Docker Debugging
Quick-copy Docker CLI recipes when a solo builder’s container misbehaves in dev or production.
Overview
docker-debugging is an agent skill for the Operate phase that supplies categorized Docker CLI commands for inspecting containers, logs, exec sessions, networks, and disk usage.
Install
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-docker --skill docker-debuggingWhat is this skill?
- Five reference blocks: container_inspection, log_analysis, interactive_debugging, network_debugging, resource_analysis
- Inspection shortcuts: inspect, top, stats, and port mappings for a given container ID
- Log recipes: follow, tail 100 lines, timestamps, and --since windows for incident windows
- Interactive exec: bash/sh, arbitrary commands, and root exec for permission issues
- Network checks: network inspect, nslookup, ping, and netstat inside the container
- 5 command reference categories: inspection, logs, exec, network, resources
Adoption & trust: 1 installs on skills.sh; 2 GitHub stars; 2/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
What problem does it solve?
You know something is wrong inside a container but waste cycles guessing which docker logs, exec, or network commands to run first.
Who is it for?
Solo builders debugging compose stacks, side projects on Docker Desktop, or single-node production without a dedicated SRE runbook.
Skip if: Teams that already rely on full APM/tracing with no shell access policy exceptions, or pure Kubernetes-only workflows where kubectl debug replaces docker exec.
When should I use this skill?
A container fails health checks, logs are unclear, or you need exec/network verification on a running Docker workload.
What do I get? / Deliverables
You get a structured command list to inspect state, stream logs, shell in, and test connectivity so you can isolate the failure faster.
- Ordered Docker CLI commands for the active incident scenario
- Log tail/follow commands with time windows for correlation
- In-container network and process checks to narrow root cause
Recommended Skills
Journey fit
Broken or flaky containers are triaged after ship, when you need logs, exec, and network checks under pressure. Maps to error response: inspect state, tail logs, exec shells, and verify DNS/connectivity before rolling back or patching.
How it compares
Use as a procedural CLI playbook instead of asking the agent to improvise docker commands from memory.
Common Questions / FAQ
Who is docker-debugging for?
Indie developers and small teams shipping containerized apps who want copy-paste Docker debugging steps during incidents or local dev failures.
When should I use docker-debugging?
In Operate when containers crash-loop or miss dependencies; in Ship when CI-built images fail smoke tests; in Build when compose networking blocks API calls between services.
Is docker-debugging safe to install?
It is reference documentation for powerful host and container commands—review the Security Audits panel on this page and restrict exec/root usage on production systems.
SKILL.md
READMESKILL.md - Docker Debugging
# Docker Debugging Commands Reference # Version: 1.0.0 # Last Updated: 2025-12-29 container_inspection: # View container details inspect: "docker inspect <container_id>" # View running processes top: "docker top <container_id>" # View resource usage stats: "docker stats <container_id> --no-stream" # View port mappings port: "docker port <container_id>" log_analysis: # View all logs all_logs: "docker logs <container_id>" # Follow logs in real-time follow: "docker logs -f <container_id>" # Last N lines tail: "docker logs --tail 100 <container_id>" # With timestamps timestamps: "docker logs -t <container_id>" # Since specific time since: "docker logs --since 30m <container_id>" interactive_debugging: # Start bash in running container exec_bash: "docker exec -it <container_id> /bin/bash" # Start sh (if bash not available) exec_sh: "docker exec -it <container_id> /bin/sh" # Run specific command exec_cmd: "docker exec <container_id> <command>" # As root user exec_root: "docker exec -u root -it <container_id> /bin/bash" network_debugging: # View container networks network_inspect: "docker network inspect <network_name>" # Test DNS resolution dns_test: "docker exec <container_id> nslookup <hostname>" # Test connectivity ping_test: "docker exec <container_id> ping -c 3 <target>" # Check open ports netstat: "docker exec <container_id> netstat -tlnp" resource_analysis: # Disk usage system_df: "docker system df -v" # Container size container_size: "docker ps -s" # Image layers image_history: "docker history <image>" health_checks: # View health status health_status: "docker inspect --format='{{.State.Health.Status}}' <container_id>" # View health logs health_log: "docker inspect --format='{{range .State.Health.Log}}{{.Output}}{{end}}' <container_id>" common_issues: container_not_starting: - "Check logs: docker logs <container_id>" - "Check exit code: docker inspect -f '{{.State.ExitCode}}' <container_id>" - "Review entrypoint/cmd in Dockerfile" high_memory_usage: - "Check limits: docker stats" - "Add memory limit: --memory=512m" - "Review application memory leaks" network_issues: - "Check network mode: docker inspect -f '{{.NetworkSettings.Networks}}' <container_id>" - "Verify DNS: docker exec <container_id> cat /etc/resolv.conf" - "Test inter-container: docker exec <container_id> ping <other_container>" # Docker Debugging Guide ## Quick Reference ### Container Won't Start 1. **Check exit code:** ```bash docker inspect -f '{{.State.ExitCode}}' <container> ``` - Exit 0: Normal termination - Exit 1: Application error - Exit 137: OOM killed (out of memory) - Exit 139: Segmentation fault - Exit 143: SIGTERM received 2. **View logs:** ```bash docker logs <container> ``` 3. **Debug entrypoint:** ```bash docker run -it --entrypoint /bin/sh <image> ``` ### High Memory Usage 1. **Check current usage:** ```bash docker stats <container> ``` 2. **Set memory limits:** ```bash docker run -m 512m --memory-swap 1g <image> ``` 3. **Find memory hogs:** ```bash docker exec <container> ps aux --sort=-%mem | head ``` ### Network Issues 1. **Container can't reach internet:** ```bash # Check DNS docker exec <container> cat /etc/resolv.conf # Test connectivity docker exec <container> ping -c 3 8.8.8.8 ``` 2. **Containers can't communicate:** ```bash # Ensure same network docker network inspect <network> # Use container name as hostname docker exec <container1> ping <container2_name> ``` ### Disk Space Issues 1. **Check Docker disk usage:** ```bash docker system df -v ``` 2. **Cleanup unused resources:** ```bash # Remove unused containers, networks, images docker system prune -a # Remove unused volumes docker volume prune ``` ## Best Practices 1. **Always use health checks**