docker-debug
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-10-02
- Stars
- ★ 9
- Forks
- 1
02 资源文件 8
- 参考文档algorithms.md97 B
- 参考文档failure_modes.md100 B
- 参考文档formulas.md95 B
- 参考文档implementation_notes.md107 B
- 参考文档integration_arbitragex.md109 B
- 参考文档manifest.json866 B
- 参考文档references.json287 B
- 参考文档validation_tests.md103 B
03 SKILL.md 正文
/docker-debug — Docker Compose Debugging Skill
Trigger
User says: "docker-debug", "container issue", "docker logs", "service down", "container networking", "docker health"
Purpose
Debug Docker Compose production deployments systematically.
Steps
1. Status Overview
docker compose ps -a # All containers with status
docker compose ps --format json | jq . # Structured output
docker stats --no-stream # CPU/memory snapshot
2. Log Investigation
docker compose logs --tail=50 SERVICE_NAME # Recent logs
docker compose logs --tail=100 --since=5m SERVICE # Last 5 minutes
docker compose logs SERVICE_NAME 2>&1 | grep -i "error\|fatal\|exception" | tail -20
3. Container Health Checks
- ALWAYS use
docker execfor health checks from INSIDE containers — NOT localhost - For inter-service checks:
docker exec CONTAINER curl -s http://SERVICE_NAME:PORT/health - For public URL checks: use the actual domain, not localhost
docker exec CONTAINER_NAME curl -sf http://localhost:PORT/health
docker inspect --format='{{.State.Health.Status}}' CONTAINER_NAME
4. Networking Debug
- Think container-to-container networking FIRST, not localhost
docker network ls
docker network inspect NETWORK_NAME
docker exec CONTAINER ping -c 2 OTHER_SERVICE # Inter-container connectivity
docker exec CONTAINER nslookup OTHER_SERVICE # DNS resolution
docker compose exec SERVICE_NAME netstat -tlnp # Open ports inside container
5. Resource Issues
docker system df # Disk usage
docker system prune --dry-run # What would be cleaned
docker volume ls # Check volumes
docker exec CONTAINER df -h # Disk inside container
6. Restart & Recovery
docker compose restart SERVICE_NAME # Soft restart
docker compose up -d --force-recreate SERVICE_NAME # Hard restart
docker compose down && docker compose up -d # Full restart
Rules
- Do NOT use
version:key in docker-compose.yml (deprecated) - Do NOT run
docker system prunewithout user confirmation - Do NOT run
docker compose down -v(destroys volumes) without explicit approval - Always check logs BEFORE restarting — restarts destroy log context
- For database containers, NEVER force-remove without checking data volumes
04 同仓库更多 Skills
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
writing-plans
Use when you have a spec or requirements for a multi-step task, before touching code
docs:write-concisely
Apply writing rules to any documentation that humans will read. Makes your writing clearer, stronger, and more professional.
kaizen:why
Iterative Five Whys root cause analysis drilling from symptoms to fundamentals
verification-loop
A comprehensive verification system for Claude Code sessions.
verification-before-completion
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always