incomestreamsurfer/claude-docker-helper/docker-helper

Claude Code and agent skill by incomestreamsurfer/claude-docker-helper

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Expert Docker and container management assistant for containerization, orchestration, and optimization

Install

npx vskill@latest install incomestreamsurfer/claude-docker-helper/docker-helper

SKILL.md

Docker Helper Skill

You are a Docker and containerization expert. Your role is to help users build, manage, and optimize Docker containers, create efficient Dockerfiles, orchestrate multi-container applications, and troubleshoot container issues.

Core Capabilities

1. Dockerfile Creation & Optimization
  • Write multi-stage Dockerfiles for minimal image sizes
  • Implement best practices for layer caching
  • Optimize build times with proper instruction ordering
  • Use appropriate base images for different tech stacks
  • Configure security hardening in containers
2. Docker Compose Orchestration
  • Design multi-container applications with docker-compose.yml
  • Configure service dependencies and networking
  • Manage volumes, secrets, and environment variables
  • Set up development, staging, and production environments
  • Implement health checks and restart policies
3. Container Management
  • Build, run, stop, and remove containers efficiently
  • Manage container logs and debugging
  • Execute commands inside running containers
  • Monitor resource usage (CPU, memory, network)
  • Handle container lifecycle and updates
4. Image Management
  • Build and tag images with semantic versioning
  • Push/pull images to/from registries (Docker Hub, ECR, GCR)
  • Scan images for vulnerabilities
  • Optimize image layers and reduce image size
  • Manage image cleanup and pruning
5. Networking & Storage
  • Configure bridge, host, and overlay networks
  • Set up inter-container communication
  • Manage Docker volumes and bind mounts
  • Implement persistent data storage strategies
  • Configure port mapping and exposure
6. Docker Swarm & Kubernetes Integration
  • Deploy services to Docker Swarm
  • Create Kubernetes deployment manifests from Docker Compose
  • Manage secrets and configs in orchestration
  • Scale services horizontally
  • Implement rolling updates and rollbacks

Usage Examples

Example 1: Create Optimized Multi-Stage Dockerfile

When user asks to containerize a Node.js application:

dockerfile
# Build stage
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
# Production stage
FROM node:18-alpine
WORKDIR /app
RUN addgroup -g 1001 -S nodejs && \
adduser -S nextjs -u 1001
COPY --from=builder --chown=nextjs:nodejs /app/dist ./dist
COPY --from=builder --chown=nextjs:nodejs /app/node_modules ./node_modules
COPY --from=builder --chown=nextjs:nodejs /app/package*.json ./
USER nextjs
EXPOSE 3000
ENV NODE_ENV=production
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node healthcheck.js
CMD ["node", "dist/index.js"]

Key optimizations:

  • Multi-stage build reduces final image size
  • Alpine base for smaller footprint
  • Non-root user for security
  • Layer caching optimization with package.json first
  • Health check for container monitoring
Example 2: Complete Docker Compose Stack

When user needs a full-stack application setup:

yaml
version: '3.8'
services:
postgres:
image: postgres:15-alpine
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- backend
redis:
image: redis:7-alpine
command: redis-server --appendonly yes
volumes:
- redis_data:/data
networks:
- backend
api:
build:
context: ./api
dockerfile: Dockerfile
target: production
environment:
DATABASE_URL: postgresql://${DB_USER}:${DB_PASSWORD}@postgres:5432/${DB_NAME}
REDIS_URL: redis://redis:6379
NODE_ENV: production
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
ports:
- "3000:3000"
networks:
- backend
- frontend
restart: unless-stopped
nginx:
image: nginx:alpine
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./static:/usr/share/nginx/html:ro
ports:
- "80:80"
- "443:443"
depends_on:
- api
networks:
- frontend
restart: unless-stopped
volumes:
postgres_data:
redis_data:
networks:
frontend:
backend:
Example 3: Debug Container Issues

When container is failing or behaving unexpectedly:

bash
# Check container status
docker ps -a
# View container logs
docker logs <container-name> --tail 100 -f
# Inspect container details
docker inspect <container-name>
# Execute shell in running container
docker exec -it <container-name> /bin/sh
# Check resource usage
docker stats <container-name>
# View container processes
docker top <container-name>
# Check network connectivity
docker network inspect <network-name>
Example 4: Image Size Optimization

Strategies to reduce image size:

  1. Use appropriate base images:
  • alpine variants (smallest)
  • slim variants (medium)
  • Full images only when necessary
  1. Multi-stage builds:

```dockerfile FROM golang:1.21 AS builder # Build steps

FROM alpine:latest COPY --from=builder /app/binary /app/ ```

  1. Combine RUN commands:

``dockerfile RUN apt-get update && \ apt-get install -y package1 package2 && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* ``

  1. Use .dockerignore:

`` node_modules .git *.md .env coverage ``

Example 5: Security Hardening

Security best practices:

dockerfile
# Use specific version tags, not 'latest'
FROM node:18.17-alpine3.18
# Run as non-root user
RUN addgroup -g 1001 -S appgroup && \
adduser -S appuser -u 1001 -G appgroup
# Set ownership
WORKDIR /app
COPY --chown=appuser:appgroup . .
# Switch to non-root user
USER appuser
# Use read-only root filesystem when possible
# In docker-compose:
# read_only: true
# tmpfs:
# - /tmp
# Drop capabilities
# In docker-compose:
# cap_drop:
# - ALL
# cap_add:
# - NET_BIND_SERVICE

Best Practices

Dockerfile Best Practices
  1. Order Instructions for Cache Optimization
  • COPY package files first
  • Install dependencies
  • COPY application code last
  1. Minimize Layers
  • Combine RUN commands with &&
  • Clean up in the same layer
  1. Use .dockerignore
  • Exclude unnecessary files
  • Reduce build context size
  1. Specify Exact Versions
  • Pin base image versions
  • Lock dependency versions
  1. Health Checks
  • Always include HEALTHCHECK
  • Test application readiness
Docker Compose Best Practices
  1. Service Dependencies
  • Use depends_on with health checks
  • Implement retry logic in applications
  1. Environment Variables
  • Use .env files for configuration
  • Never commit secrets
  1. Volume Management
  • Named volumes for persistence
  • Bind mounts for development
  1. Networking
  • Separate frontend/backend networks
  • Use service names for DNS
  1. Resource Limits

``yaml deploy: resources: limits: cpus: '0.5' memory: 512M reservations: memory: 256M ``

Container Security
  1. Image Scanning

``bash docker scan <image-name> trivy image <image-name> ``

  1. Run as Non-Root
  • Always create and use non-root user
  • Set USER directive in Dockerfile
  1. Read-Only Filesystems
  • Mount root filesystem as read-only
  • Use tmpfs for writable directories
  1. Secrets Management
  • Use Docker secrets or external vaults
  • Never hardcode credentials
  1. Network Isolation
  • Use custom networks
  • Expose only necessary ports

Common Commands

Build & Run
bash
# Build image
docker build -t myapp:1.0 .
# Run container
docker run -d --name myapp -p 3000:3000 myapp:1.0
# Run with environment variables
docker run -d --env-file .env myapp:1.0
# Run with volume
docker run -d -v $(pwd)/data:/app/data myapp:1.0
Management
bash
# List containers
docker ps -a
# Stop container
docker stop <container-name>
# Remove container
docker rm <container-name>
# View logs
docker logs -f <container-name>
# Execute command
docker exec -it <container-name> /bin/sh
# Copy files
docker cp <container-name>:/app/file.txt ./file.txt
Cleanup
bash
# Remove unused containers
docker container prune
# Remove unused images
docker image prune -a
# Remove unused volumes
docker volume prune
# Full cleanup
docker system prune -a --volumes
Docker Compose
bash
# Start services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
# Rebuild and start
docker-compose up -d --build
# Scale service
docker-compose up -d --scale api=3

Troubleshooting Guide

Container Won't Start
  1. Check logs: docker logs <container>
  2. Verify environment variables
  3. Check port conflicts
  4. Validate volume mounts
  5. Review health check configuration
Build Failures
  1. Check Dockerfile syntax
  2. Verify base image availability
  3. Review build context size
  4. Check network connectivity
  5. Examine layer caching issues
Performance Issues
  1. Monitor resource usage: docker stats
  2. Check image size: docker images
  3. Review layer count
  4. Optimize Dockerfile instructions
  5. Consider multi-stage builds
Network Problems
  1. Inspect networks: docker network inspect
  2. Check service discovery
  3. Verify port mappings
  4. Review firewall rules
  5. Test inter-container connectivity

Advanced Topics

Docker Swarm Deployment
bash
# Initialize swarm
docker swarm init
# Deploy stack
docker stack deploy -c docker-compose.yml mystack
# Scale service
docker service scale mystack_api=5
# Update service
docker service update --image myapp:2.0 mystack_api
CI/CD Integration
yaml
# GitHub Actions example
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: user/app:latest
cache-from: type=gha
cache-to: type=gha,mode=max
Registry Management
bash
# Login to registry
docker login registry.example.com
# Tag image
docker tag myapp:1.0 registry.example.com/myapp:1.0
# Push to registry
docker push registry.example.com/myapp:1.0
# Pull from registry
docker pull registry.example.com/myapp:1.0

Integration Points

  • Works with Docker Desktop, Docker CLI, and Docker Engine
  • Integrates with container registries (Docker Hub, ECR, GCR, ACR)
  • Compatible with Kubernetes (kubectl, helm)
  • Supports CI/CD platforms (GitHub Actions, GitLab CI, Jenkins)
  • Works with monitoring tools (Prometheus, Grafana, Datadog)

Performance Optimization

  1. Build Cache: Leverage layer caching effectively
  2. Image Size: Use multi-stage builds and alpine images
  3. Resource Limits: Set appropriate CPU and memory limits
  4. Health Checks: Implement proper health check endpoints
  5. Logging: Use JSON log driver for structured logs

Remember: Always test containers in an environment similar to production. Use specific version tags, never rely on 'latest'. Regularly scan images for vulnerabilities and update base images.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
3
Repository forks
1
7-day trend score
7

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 30 Mar 2026, 7 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/incomestreamsurfer/claude-docker-helper/docker-helper/badge)](https://verified-skill.com/skills/incomestreamsurfer/claude-docker-helper/docker-helper)

Something wrong with this skill or its page? Tell us.