database-expert
Expert database architect specializing in schema design, query optimization, data modeling, and migration strategies. Japanese: データベースエキスパート
Helps diagnose and resolve Docker container issues including build failures, runtime errors, networking problems, and performance issues.
> /plugin marketplace add Fujigo-Software/f5-framework-claudeHow it fires
How this agent gets triggered: by you, by Claude, or both.
Context preview
The summary Claude sees to decide when to auto-load this agent.
Helps diagnose and resolve Docker container issues including build failures, runtime errors, networking problems, and performance issues.
Helps diagnose and resolve Docker container issues including build failures, runtime errors, networking problems, and performance issues.
# Step 1: Check container logs docker logs <container_name> docker logs --tail 100 -f <container_name> # Step 2: Check container status docker ps -a docker inspect <container_name> # Step 3: Check events docker events --since 10m # Step 4: Try running interactively docker run -it --rm <image> /bin/sh # Step 5: Override entrypoint to debug docker run -it --rm --entrypoint /bin/sh <image>
issue: "exec format error"
cause: "Image built for different architecture"
solution: |
# Build for correct platform
docker build --platform linux/amd64 -t myapp .
# Or use multi-platform build
docker buildx build --platform linux/amd64,linux/arm64 -t myapp .
issue: "permission denied"
cause: "File permissions or non-root user issues"
solution: |
# Check file ownership in container
docker run --rm <image> ls -la /app
# Ensure correct ownership in Dockerfile
COPY --chown=appuser:appgroup . .
issue: "OOMKilled"
cause: "Container exceeded memory limit"
solution: |
# Increase memory limit
docker run -m 2g myapp
# Or in docker-compose
deploy:
resources:
limits:
memory: 2G
issue: "port already in use"
cause: "Host port conflict"
solution: |
# Find what's using the port
lsof -i :3000
# Use different host port
docker run -p 3001:3000 myapp# Step 1: Build with verbose output docker build --progress=plain -t myapp . # Step 2: Build without cache to see full output docker build --no-cache -t myapp . # Step 3: Build specific stage docker build --target builder -t myapp:builder . # Step 4: Check build context docker build --progress=plain -t myapp . 2>&1 | head -20 # Look for "Sending build context to Docker daemon" # Step 5: Debug failing RUN command # Add this before failing command: RUN ls -la && pwd
issue: "COPY failed: file not found" cause: "File not in build context or in .dockerignore" solution: | # Check build context ls -la # Check .dockerignore cat .dockerignore # Ensure file exists and not ignored issue: "npm install fails" cause: "Network issues or missing dependencies" solution: | # Add network retries RUN npm ci --retry 3 # Or use cache mount RUN --mount=type=cache,target=/root/.npm npm ci issue: "build context too large" cause: "Large files or node_modules in context" solution: | # Create proper .dockerignore node_modules .git *.log dist build issue: "multi-stage COPY --from fails" cause: "Stage name mismatch or target doesn't exist" solution: | # Verify stage names match FROM node:20 AS builder # Note: "builder" COPY --from=builder /app/dist ./dist # Must match
# Step 1: Check container network
docker network ls
docker network inspect <network_name>
# Step 2: Check container IP and ports
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <container>
docker port <container>
# Step 3: Test connectivity from inside container
docker exec -it <container> /bin/sh
ping <other_container>
wget -O- http://api:4000/health
nslookup api
# Step 4: Check DNS resolution
docker exec -it <container> cat /etc/resolv.conf
docker exec -it <container> nslookup <service_name>
# Step 5: Test from host
curl localhost:3000
docker compose logs apiissue: "connection refused" cause: "Service not listening on expected address" solution: | # Service must listen on 0.0.0.0, not localhost # Node.js app.listen(3000, '0.0.0.0') # Python app.run(host='0.0.0.0', port=3000) issue: "name resolution failure" cause: "Container not on same network or DNS issue" solution: | # Ensure containers on same network docker network connect mynetwork container1 docker network connect mynetwork container2 # Or in compose, use same network issue: "port not accessible from host" cause: "Port not published or firewall" solution: | # Check port mapping docker port <container> # Ensure port is published docker run -p 3000:3000 myapp
# Step 1: List volumes docker volume ls docker volume inspect <volume_name> # Step 2: Check mount inside container docker exec -it <container> ls -la /app/data docker exec -it <container> df -h # Step 3: Check permissions docker exec -it <container> id docker exec -it <container> stat /app/data # Step 4: Test write access docker exec -it <container> touch /app/data/test.txt
issue: "permission denied on volume"
cause: "User ID mismatch between host and container"
solution: |
# Option 1: Match container UID to host
RUN chown -R 1000:1000 /app/data
# Option 2: Use named volume (Docker manages permissions)
volumes:
- app_data:/app/data
# Option 3: Set permissions in entrypoint
ENTRYPOINT ["sh", "-c", "chown -R appuser:appgroup /app/data && exec \"$@\"", "--"]
issue: "changes not reflected (bind mount)"
cause: "Caching or wrong path"
solution: |
# Verify path is correct
docker inspect <container> | jq '.[0].MouRepo: Fujigo-Software/f5-framework-claude
Expert database architect specializing in schema design, query optimization, data modeling, and migration strategies. Japanese: データベースエキスパート
Expert DevOps architect specializing in CI/CD pipelines, infrastructure as code, containerization, and monitoring. Japanese: DevOpsアーキテクト
Mobile app architecture specialist. iOS, Android, React Native, Flutter.
Backend architecture specialist. Microservices, APIs, databases.
Frontend architecture specialist. React, Vue, Angular, Next.js.