Container debugging and troubleshooting techniques for production issues
Diagnose container crashes, health failures, and resource issues using targeted Docker commands. Triggered when troubleshooting production containers or investigating startup failures, network problems, and performance bottlenecks.
/plugin marketplace add pluginagentmarketplace/custom-plugin-docker/plugin install pluginagentmarketplace-docker-container-assistant@pluginagentmarketplace/custom-plugin-dockerThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/debug-commands.yamlreferences/DEBUGGING-GUIDE.mdscripts/container-health-check.shMaster container debugging and troubleshooting for development and production issues.
Diagnose and resolve container issues including crashes, performance problems, networking failures, and resource constraints.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| container | string | No | - | Container name/ID |
| issue_type | enum | No | - | crash/network/resource/health |
| verbose | boolean | No | false | Detailed output |
# Last 100 lines
docker logs --tail 100 <container>
# Follow logs
docker logs -f <container>
# With timestamps
docker logs -t <container>
# Specific time range
docker logs --since 1h --until 30m <container>
# Execute shell in running container
docker exec -it <container> /bin/sh
# As root (for debugging)
docker exec -u 0 -it <container> /bin/sh
# Run command
docker exec <container> ps aux
# Full inspection
docker inspect <container>
# Specific fields
docker inspect --format='{{.State.Status}}' <container>
docker inspect --format='{{.State.Health.Status}}' <container>
docker inspect --format='{{json .NetworkSettings}}' <container>
# Check exit code
docker inspect --format='{{.State.ExitCode}}' <container>
# View last logs
docker logs --tail 50 <container>
# Check events
docker events --filter 'container=<name>' --since 1h
| Code | Meaning | Action |
|---|---|---|
| 0 | Success | Normal exit |
| 1 | General error | Check logs |
| 137 | OOMKilled | Increase memory |
| 139 | Segfault | Check app code |
| 143 | SIGTERM | Graceful shutdown |
# Check health status
docker inspect --format='{{json .State.Health}}' <container>
# View health logs
docker inspect --format='{{range .State.Health.Log}}{{.Output}}{{end}}' <container>
# Manually test health
docker exec <container> curl -f http://localhost/health
# Live stats
docker stats <container>
# Formatted output
docker stats --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}"
# Check limits
docker inspect --format='{{.HostConfig.Memory}}' <container>
# Check network
docker network inspect <network>
# Test DNS
docker exec <container> nslookup <service>
# Test connectivity
docker exec <container> ping -c 3 <target>
docker exec <container> curl http://<service>:port
# View ports
docker port <container>
Container Issue?
│
├─ Won't Start
│ ├─ Check logs: docker logs <c>
│ ├─ Check exit code: docker inspect
│ └─ Verify image: docker pull
│
├─ Unhealthy
│ ├─ Check health logs
│ ├─ Test health endpoint manually
│ └─ Increase start_period
│
├─ High Resource
│ ├─ Check stats: docker stats
│ ├─ Increase limits
│ └─ Profile application
│
└─ Network Failed
├─ Check DNS: nslookup
├─ Check connectivity: ping/curl
└─ Verify network membership
# Run debug container in same network
docker run --rm -it --network <network> \
nicolaka/netshoot
# Available tools: curl, dig, nmap, tcpdump, etc.
| Error | Cause | Solution |
|---|---|---|
container not found | Wrong name/ID | Use docker ps -a |
exec failed | Container stopped | Start container first |
no such file | Missing binary | Use correct image |
Skill("docker-debugging")
assets/debug-commands.yaml - Command referencescripts/container-health-check.sh - Health check scriptThis skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.