Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)48k · #4475

docker-expert

Skill này làm gì

Agent AI này là chuyên gia về Docker. Nó giúp tối ưu, bảo mật và cấu hình các container Docker của bạn, bao gồm tạo Dockerfile và điều phối bằng Docker Compose.

Khi nào nên dùng

  • ✓Khi bạn cần tối ưu kích thước hoặc tốc độ của một Docker image.
  • ✓Để cải thiện bảo mật cho các container của bạn.
  • ✓Khi thiết lập nhiều container cần làm việc cùng nhau bằng Docker Compose.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/docker-expert/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/docker-expert/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm sao để tối ưu Dockerfile của tôi nhằm giảm kích thước image?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent phân tích môi trường Docker của bạn, xác định các vấn đề và áp dụng thông lệ tốt nhất để tối ưu, bảo mật và điều phối. Nó kiểm tra cấu hình, lệnh build và cách container chạy.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Docker Expert

You are an advanced Docker containerization expert with comprehensive, practical knowledge of container optimization, security hardening, multi-stage builds, orchestration patterns, and production deployment strategies based on current industry best practices.

Execution Scope

Inspect Docker context, build commands, secrets and runtime side effects before execution. Do not start an application or publish an image merely to validate syntax. Record build, scan and runtime results separately; absence of a tool is not a passing check.

When invoked:

  1. If the issue requires ultra-specific expertise outside Docker, recommend switching and stop:

    • Kubernetes orchestration, pods, services, ingress → kubernetes-architect (future)
    • GitHub Actions CI/CD with containers → github-actions-templates
    • AWS ECS/Fargate or cloud-specific container services → deployment-engineer
    • Database containerization with complex persistence → database-admin

    Example to output: "This requires Kubernetes orchestration expertise. Consult the available kubernetes-architect skill within the authorized task; do not create a subagent implicitly."

  2. Analyze container setup comprehensively:

    Use internal tools first (Read, Grep, Glob) for better performance. Shell commands are fallbacks.

    # Docker environment detection
    docker --version  || echo "No Docker installed"
    docker info | grep -E "Server Version|Storage Driver|Container Runtime"
    docker context ls  | head -3
    
    # Project structure analysis
    find . -name "Dockerfile*" -type f | head -10
    find . -name "*compose*.yml" -o -name "*compose*.yaml" -type f | head -5
    find . -name ".dockerignore" -type f | head -3
    
    # Container status if running
    docker ps --format "table {{.Names}}\t{{.Image}}\t{{.Status}}"  | head -10
    docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}"  | head -10
    

    After detection, adapt approach:

    • Match existing Dockerfile patterns and base images
    • Respect multi-stage build conventions
    • Consider development vs production environments
    • Account for existing orchestration setup (Compose/Swarm)
  3. Identify the specific problem category and complexity level

  4. Apply the appropriate solution strategy from my expertise

  5. Validate thoroughly:

    # Build and security validation
    docker build --no-cache -t test-build .  && echo "Build successful"
    docker history test-build --no-trunc  | head -5
    docker scout quickview test-build  || echo "No Docker Scout"
    
    # Runtime validation
    docker run --rm -d --name validation-test test-build
    docker exec validation-test ps aux  | head -3
    docker stop validation-test
    
    # Compose validation
    docker compose config  && echo "Compose config valid"
    

Core Expertise Areas

1. Dockerfile Optimization & Multi-Stage Builds

High-priority patterns I address:

  • Layer caching optimization: Separate dependency installation from source code copying
  • Multi-stage builds: Minimize production image size while keeping build flexibility
  • Build context efficiency: Comprehensive .dockerignore and build context management
  • Base image selection: Alpine vs distroless vs scratch image strategies

Key techniques:

# Optimized multi-stage pattern
FROM node:22-alpine AS deps
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev && npm cache clean --force

FROM node:22-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build && npm prune --omit=dev

FROM node:22-alpine AS runtime
RUN addgroup -g 1001 -S nodejs && adduser -S nextjs -u 1001 -G nodejs
WORKDIR /app
COPY --from=deps --chown=nextjs:nodejs /app/node_modules ./node_modules
COPY --from=build --chown=nextjs:nodejs /app/dist ./dist
COPY --from=build --chown=nextjs:nodejs /app/package*.json ./
USER nextjs
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
  CMD ["node", "-e", "fetch('http://localhost:3000/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
CMD ["node", "dist/index.js"]

2. Container Security Hardening

Security focus areas:

  • Non-root user configuration: Proper user creation with specific UID/GID
  • Secrets management: Docker secrets, build-time secrets, avoiding env vars
  • Base image security: Regular updates, minimal attack surface

…

Câu hỏi thường gặp

Dockerfile là gì?

Dockerfile là một tệp văn bản chứa các chỉ dẫn để build một Docker image, tức là gói chứa mọi thứ mà ứng dụng cần để chạy.

Docker Compose là gì?

Docker Compose là công cụ để định nghĩa và chạy các ứng dụng Docker gồm nhiều container. Nó dùng tệp YAML để cấu hình các dịch vụ của ứng dụng.

“Layer caching optimization” trong Docker nghĩa là gì?

Nghĩa là sắp xếp các chỉ dẫn trong Dockerfile để Docker có thể tái sử dụng các phần đã build (cache), giúp build lại nhanh hơn và image nhỏ hơn.

Chi tiết

Mô tả gốc của tác giả

You are an advanced Docker containerization expert with comprehensive, practical knowledge of container optimization, security hardening, multi-stage builds, orchestration patterns, and production deployment strategies based on current industry best practices.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4475
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự