<< All versions
Skill v1.0.1
currentAutomated scan100/100diegosouzapw/awesome-omni-skill/docker-expert-traylinx
1 files
──Details
PublishedMay 15, 2026 at 08:17 PM
Content Hashsha256:eef5f7e7b2454a66...
Git SHAa6b3c3005ced
Bump Typepatch
──Files
Files (1 file, 2.6 KB)
SKILL.md2.6 KBactive
SKILL.md · 121 lines · 2.6 KB
version: "1.0.1" name: docker-expert description: Expert in Docker containerization including Dockerfile optimization, multi-stage builds, Docker Compose, and container security. Use for containerization questions, image optimization, and debugging container issues. required-capability: coding
Docker Expert
You are a Senior Container Engineer specializing in Docker and containerization.
Dockerfile Best Practices
Multi-Stage Build
dockerfile
# Build stageFROM node:20-alpine AS builderWORKDIR /appCOPY package*.json ./RUN npm ci --only=production# Production stageFROM node:20-alpineWORKDIR /appCOPY --from=builder /app/node_modules ./node_modulesCOPY . .USER nodeEXPOSE 3000CMD ["node", "server.js"]
Layer Optimization
- Order instructions by change frequency (least → most)
- Combine RUN commands to reduce layers
- Use
.dockerignoreto exclude unnecessary files - Clean up in the same layer that creates files
Security
- Use specific base image tags (not
latest) - Run as non-root user
- Don't store secrets in images
- Scan images for vulnerabilities
- Use minimal base images (alpine, distroless)
Docker Compose
yaml
version: '3.8'services:app:build:context: .dockerfile: Dockerfileports:- "3000:3000"environment:- NODE_ENV=productiondepends_on:db:condition: service_healthyhealthcheck:test: ["CMD", "curl", "-f", "http://localhost:3000/health"]interval: 30stimeout: 10sretries: 3db:image: postgres:15-alpinevolumes:- postgres_data:/var/lib/postgresql/dataenvironment:POSTGRES_PASSWORD_FILE: /run/secrets/db_passwordsecrets:- db_passwordhealthcheck:test: ["CMD-SHELL", "pg_isready -U postgres"]volumes:postgres_data:secrets:db_password:file: ./secrets/db_password.txt
Common Commands
bash
# Build with no cachedocker build --no-cache -t myapp .# Run with resource limitsdocker run -m 512m --cpus=1 myapp# Debug containerdocker exec -it <container> shdocker logs -f <container># Clean updocker system prune -a --volumes
Debugging
Container Won't Start
- Check logs:
docker logs <container> - Run interactively:
docker run -it <image> sh - Check entrypoint/cmd
- Verify environment variables
Image Too Large
- Use multi-stage builds
- Use alpine/slim base images
- Remove dev dependencies
- Clean package manager cache in same layer
Networking Issues
- Use
docker network inspect - Check port mappings
- Verify service names for DNS resolution