Diagnose and fix docker-local issues - container failures, connectivity problems, port conflicts, and configuration errors
Diagnoses and fixes docker-local issues like container failures, port conflicts, and connectivity problems. Activates when users report Docker errors or services won't start. Runs `docker-local fix` for automatic resolution, then uses targeted commands to address specific problems like DNS, permissions, or database connections.
/plugin marketplace add mwguerra/claude-code-plugins/plugin install docker-local@mwguerra-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
This skill helps diagnose and fix common docker-local issues including:
Use this skill when:
Before ANY docker-local command, verify installation:
which docker-local > /dev/null 2>&1
If docker-local is NOT found:
composer global require mwguerra/docker-localexport PATH="$HOME/.composer/vendor/bin:$PATH"docker-local initwhich docker-local && docker-local --versionUse the fix command for automatic diagnosis and resolution:
# Run all checks and auto-fix what's possible
docker-local fix
# Target specific areas
docker-local fix --dns # Only check/fix DNS issues
docker-local fix --docker # Only check/fix Docker daemon
docker-local fix --services # Only check/fix container services
docker-local fix --hosts # Only check/fix /etc/hosts
# Additional options
docker-local fix --verbose # Show detailed diagnostic info
docker-local fix --dry-run # Show what would be fixed without making changes
The fix command automatically detects and resolves:
# Check docker-local status
docker-local status
# View recent logs
docker-local logs --tail=50
# Check Docker system
docker info
docker system df
Error: Docker is not running
Diagnosis:
docker info 2>&1
systemctl status docker # Linux
Fix:
# Linux
sudo systemctl start docker
# macOS
open -a Docker
# Windows (WSL2)
# Start Docker Desktop from Windows Start Menu
Error: Port 3306 already in use
Diagnosis:
# Find what's using the port
lsof -i :3306
netstat -tulpn | grep 3306
# Common ports to check:
# 80, 443 - Traefik/HTTP
# 3306 - MySQL
# 5432 - PostgreSQL
# 6379 - Redis
# 9000, 9001 - MinIO
# 1025, 8025 - Mailpit
Fix:
# Kill the process using the port
kill $(lsof -t -i:3306)
# Or change port in config
# Edit ~/.config/docker-local/config.json
Container php: Exited (1)
Diagnosis:
# Check logs for the failing container
docker-local logs php
# Check exit code
docker inspect --format='{{.State.ExitCode}}' php
# Exit codes:
# 0 - Normal stop
# 1 - Application error
# 137 - Out of memory (OOM killed)
# 139 - Segmentation fault
Fix based on exit code:
# Exit 1 - Check application logs
docker-local logs php --tail=100
# Exit 137 - Increase Docker memory
# Docker Desktop > Settings > Resources > Memory
# Restart the container
docker-local restart
Error: Permission denied
Diagnosis:
# Check user permissions
id
groups
# Check project permissions
ls -la ~/projects/
# Check Docker socket
ls -la /var/run/docker.sock
Fix:
# Linux: Add user to docker group
sudo usermod -aG docker $USER
newgrp docker
# Fix project permissions
sudo chown -R $USER:$USER ~/projects
# Fix socket permissions (temporary)
sudo chmod 666 /var/run/docker.sock
SQLSTATE[HY000] [2002] Connection refused
Diagnosis:
# Check if database container is running
docker-local status
# Check database logs
docker-local logs mysql
docker-local logs postgres
# Test connection from inside container
docker exec php php -r "new PDO('mysql:host=mysql;dbname=laravel', 'laravel', 'secret');"
Fix:
# Ensure services are running
docker-local up
# Wait for database to be ready (health check)
docker-local status
# Check .env has correct host (mysql, not localhost)
# DB_HOST=mysql
Could not resolve host: myapp.test
Diagnosis:
# Check if DNS is configured
ping myapp.test
# Check /etc/hosts
cat /etc/hosts | grep test
# Check dnsmasq (if used)
systemctl status dnsmasq # Linux
Fix:
# Option 1: Setup DNS (recommended)
sudo docker-local setup:dns
# Option 2: Add to /etc/hosts
sudo docker-local setup:hosts
# Option 3: Manual hosts entry
echo "127.0.0.1 myapp.test" | sudo tee -a /etc/hosts
SSL certificate problem: unable to get local issuer certificate
Diagnosis:
# Check SSL certificate status
docker-local ssl:status
# Check certificates exist
ls -la ~/.config/docker-local/certs/
# Check certificate validity
openssl x509 -in ~/.config/docker-local/certs/localhost.pem -noout -dates
# Test HTTPS
curl -vk https://localhost 2>&1 | head -20
Fix:
# Regenerate SSL certificates with mkcert
docker-local ssl:regenerate
# Or regenerate during init
docker-local init --certs
# Trust the certificate (browser)
# Import ~/.config/docker-local/certs/localhost.pem
# For mkcert users
mkcert -install
No projects found in ~/projects
Diagnosis:
# Check projects directory
ls -la ~/projects/
# Check config
docker-local config | grep projects_path
# Verify project structure
ls -la ~/projects/myapp/artisan
Fix:
# Ensure projects are in correct location
mv /path/to/myapp ~/projects/
# Or update config
# Edit ~/.config/docker-local/config.json
# Change projects_path
If all else fails, perform a complete reset:
# Stop everything
docker-local down
# Remove all Docker resources
docker system prune -af
docker volume prune -f
docker network prune -f
# Remove docker-local config (backup first)
mv ~/.config/docker-local ~/.config/docker-local.backup
# Reinitialize
docker-local init
# Restart
docker-local up
# Restore projects (they're safe in ~/projects)
docker-local list
# Shell into PHP container
docker-local shell
# Real-time Docker events
docker events
# Container resource usage
docker stats --no-stream
# Network inspection
docker network inspect laravel-dev
# Volume inspection
docker volume ls
docker volume inspect mysql_data
# Compose configuration check
docker compose -f ~/.config/docker-local/docker-compose.yml config
After troubleshooting, provide:
Issue: MySQL container not starting
Root Cause: Port 3306 already in use by local MySQL installation
Solution:
sudo systemctl stop mysql # Stop local MySQL
docker-local up # Start docker-local
Prevention:
- Use docker-local consistently
- Or change MySQL port in ~/.config/docker-local/config.json
Verification:
docker-local status # Should show mysql: Running
docker-local db:mysql # Should open MySQL CLI
$ARGUMENTS
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 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.