- Created structured documentation with /patterns/, /examples/, and /reference/ directories - Implemented automatic context loading rules in CLAUDE.md based on file extensions, directories, and keywords - Added technology-specific patterns for Docker, Python, Node.js, Vue.js, Bash, networking, databases, and VM management - Included complete working examples for common workflows and troubleshooting references - Designed for minimal context usage with precise loading triggers 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1.7 KiB
1.7 KiB
Docker Troubleshooting Reference
Container Won't Start
Check logs
docker logs <container_name>
docker logs --tail 50 -f <container_name>
Common issues
- Port already in use:
docker psto find conflicting containers - Permission errors: Check file ownership and container user
- Missing environment variables: Verify with
docker exec -it <container> env - Resource limits: Check memory/CPU constraints
Debug running container
docker exec -it <container> /bin/bash
docker exec -it <container> /bin/sh # if bash not available
Build Issues
Clear build cache
docker system prune -a
docker builder prune
Build with verbose output
docker build --progress=plain --no-cache .
Common build failures
- COPY/ADD errors: Check file paths and .dockerignore
- Package installation: Update package lists first
- Network issues: Check DNS and proxy settings
Performance Issues
Container resource usage
docker stats
docker exec <container> top
docker exec <container> free -h
Image size optimization
docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}"
docker history <image>
Network Debugging
List networks and connections
docker network ls
docker network inspect <network_name>
docker port <container>
Test connectivity
docker exec <container> ping <target>
docker exec <container> nslookup <hostname>
docker exec <container> netstat -tulpn
Quick Fixes
Remove all stopped containers
docker container prune
Remove unused images
docker image prune -a
Reset Docker completely
docker system prune -a --volumes