Diagnose container failures, networking issues, permissions, and port conflicts
Diagnoses Docker container failures, networking issues, and port conflicts by checking logs and inspecting resources. Use when containers won't start, can't communicate, or show permission errors.
/plugin marketplace add mwguerra/claude-code-plugins/plugin install taskmanager@mwguerra-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
This skill helps diagnose and resolve common Docker issues:
Read relevant documentation:
17-troubleshooting.md for common issues15-port-conflicts.md for port problems16-restart-strategies.md for restart issuesGather information:
# Check container status
docker compose ps -a
# View logs
docker compose logs servicename
# Check configuration
docker compose config
# Inspect container
docker inspect containername
Diagnosis:
docker compose logs servicename
docker inspect --format='{{.State.ExitCode}}' containername
Solutions:
Diagnosis:
lsof -i :3000
# or
netstat -tulpn | grep 3000
Solutions:
# Kill process
kill $(lsof -t -i:3000)
# Or change port in compose
ports:
- "3001:3000"
Diagnosis:
docker compose exec app ls -la /app/data
Solutions:
# Fix in compose
services:
app:
user: "1000:1000"
# Or fix in container
docker compose exec -u root app chown -R appuser:appgroup /app/data
Diagnosis:
docker volume ls
docker compose config | grep -A5 "volumes:"
Solutions:
# Use named volumes instead of anonymous
volumes:
- postgres_data:/var/lib/postgresql/data # Named (persists)
# NOT: - /var/lib/postgresql/data # Anonymous (deleted)
Diagnosis:
docker network inspect networkname
docker compose exec app ping db
docker compose exec app nslookup db
Solutions:
# Ensure same network
services:
app:
networks:
- backend
db:
networks:
- backend
networks:
backend:
Diagnosis:
docker inspect --format='{{json .State.Health}}' containername | jq
Solutions:
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s # Give time to start
Diagnosis:
docker system df
docker system df -v
Solutions:
# Clean unused resources
docker system prune -a --volumes
Solutions:
docker compose build --no-cache
docker builder prune -a
# Shell into running container
docker compose exec app sh
# Shell into failed container
docker compose run --entrypoint sh app
# View resource usage
docker stats
# View container processes
docker compose top
# View real-time events
docker events
# Copy files from container
docker compose cp app:/app/logs ./logs
docker compose psdocker compose logs servicenamedocker network lsdocker volume lsdocker statsdocker compose configdocker system df| Error | Cause | Solution |
|---|---|---|
| "port is already allocated" | Port in use | Kill process or change port |
| "network not found" | Missing network | Create network or check name |
| "volume not found" | Missing volume | Create volume or check name |
| "no such service" | Service name typo | Check compose.yaml |
| "unauthorized" | Auth issue | docker login |
| "image not found" | Missing image | docker compose pull |
| "permission denied" | File permissions | Fix ownership/permissions |
| "out of memory" | Memory limit | Increase limit or optimize app |
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 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 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.