claude-home/docker/examples/troubleshooting.md
Cal Corum 10c9e0d854 CLAUDE: Migrate to technology-first documentation architecture
Complete restructure from patterns/examples/reference to technology-focused directories:

• Created technology-specific directories with comprehensive documentation:
  - /tdarr/ - Transcoding automation with gaming-aware scheduling
  - /docker/ - Container management with GPU acceleration patterns
  - /vm-management/ - Virtual machine automation and cloud-init
  - /networking/ - SSH infrastructure, reverse proxy, and security
  - /monitoring/ - System health checks and Discord notifications
  - /databases/ - Database patterns and troubleshooting
  - /development/ - Programming language patterns (bash, nodejs, python, vuejs)

• Enhanced CLAUDE.md with intelligent context loading:
  - Technology-first loading rules for automatic context provision
  - Troubleshooting keyword triggers for emergency scenarios
  - Documentation maintenance protocols with automated reminders
  - Context window management for optimal documentation updates

• Preserved valuable content from .claude/tmp/:
  - SSH security improvements and server inventory
  - Tdarr CIFS troubleshooting and Docker iptables solutions
  - Operational scripts with proper technology classification

• Benefits achieved:
  - Self-contained technology directories with complete context
  - Automatic loading of relevant documentation based on keywords
  - Emergency-ready troubleshooting with comprehensive guides
  - Scalable structure for future technology additions
  - Eliminated context bloat through targeted loading

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-12 23:20:15 -05:00

87 lines
1.7 KiB
Markdown

# Docker Troubleshooting Reference
## Container Won't Start
### Check logs
```bash
docker logs <container_name>
docker logs --tail 50 -f <container_name>
```
### Common issues
- **Port already in use**: `docker ps` to 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
```bash
docker exec -it <container> /bin/bash
docker exec -it <container> /bin/sh # if bash not available
```
## Build Issues
### Clear build cache
```bash
docker system prune -a
docker builder prune
```
### Build with verbose output
```bash
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
```bash
docker stats
docker exec <container> top
docker exec <container> free -h
```
### Image size optimization
```bash
docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}"
docker history <image>
```
## Network Debugging
### List networks and connections
```bash
docker network ls
docker network inspect <network_name>
docker port <container>
```
### Test connectivity
```bash
docker exec <container> ping <target>
docker exec <container> nslookup <hostname>
docker exec <container> netstat -tulpn
```
## Quick Fixes
### Remove all stopped containers
```bash
docker container prune
```
### Remove unused images
```bash
docker image prune -a
```
### Reset Docker completely
```bash
docker system prune -a --volumes
```