docker-development
Skill này làm gì
Skill này hướng dẫn agent viết, tối ưu và xem lại các thiết lập container Docker. Skill dành cho lập trình viên muốn container build nhanh, kích thước nhỏ và an toàn khi chạy.
Khi nào nên dùng
- ✓Khi bản build Docker của bạn chậm hoặc image quá lớn.
- ✓Khi bạn muốn thiết lập một file docker-compose cho một dự án.
- ✓Khi bạn muốn kiểm tra Dockerfile về vấn đề bảo mật trước khi phát hành.
Liên kết skill
https://github.com/alirezarezvani/claude-skills/blob/main/engineering/docker-development/skills/docker-development/SKILL.mdSao 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
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Image Docker của tôi quá lớn và bản build chậm. Hãy tối ưu Dockerfile về kích thước và cache.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent phân tích các layer, cache và kích thước của Dockerfile, rồi gợi ý thay đổi như multi-stage build. Nó cũng kiểm tra file compose và rà soát vấn đề bảo mật trong Dockerfile hoặc một container đang 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 Development
Smaller images. Faster builds. Secure containers. No guesswork.
Opinionated Docker workflow that turns bloated Dockerfiles into production-grade containers. Covers optimization, multi-stage builds, compose orchestration, and security hardening.
Not a Docker tutorial — a set of concrete decisions about how to build containers that don't waste time, space, or attack surface.
Slash Commands
| Command | What it does |
|---|---|
/docker-development optimize |
Analyze and optimize a Dockerfile for size, speed, and layer caching |
/docker-development compose |
Generate or improve docker-compose.yml with best practices |
/docker-development security |
Audit a Dockerfile or running container for security issues |
When This Skill Activates
Recognize these patterns from the user:
- "Optimize this Dockerfile"
- "My Docker build is slow"
- "Create a docker-compose for this project"
- "Is this Dockerfile secure?"
- "Reduce my Docker image size"
- "Set up multi-stage builds"
- "Docker best practices for [language/framework]"
- Any request involving: Dockerfile, docker-compose, container, image size, build cache, Docker security
If the user has a Dockerfile or wants to containerize something → this skill applies.
Workflow
/docker-development optimize — Dockerfile Optimization
Analyze current state
- Read the Dockerfile
- Identify base image and its size
- Count layers (each RUN/COPY/ADD = 1 layer)
- Check for common anti-patterns
Apply optimization checklist
BASE IMAGE ├── Use specific tags, never :latest in production ├── Prefer slim/alpine variants (debian-slim > ubuntu > debian) ├── Pin digest for reproducibility in CI: image@sha256:... └── Match base to runtime needs (don't use python:3.12 for a compiled binary) LAYER OPTIMIZATION ├── Combine related RUN commands with && \ ├── Order layers: least-changing first (deps before source code) ├── Clean package manager cache in the same RUN layer ├── Use .dockerignore to exclude unnecessary files └── Separate build deps from runtime deps BUILD CACHE ├── COPY dependency files before source code (package.json, requirements.txt, go.mod) ├── Install deps in a separate layer from code copy ├── Use BuildKit cache mounts: --mount=type=cache,target=/root/.cache └── Avoid COPY . . before dependency installation MULTI-STAGE BUILDS ├── Stage 1: build (full SDK, build tools, dev deps) ├── Stage 2: runtime (minimal base, only production artifacts) ├── COPY --from=builder only what's needed └── Final image should have NO build tools, NO source code, NO dev depsGenerate optimized Dockerfile
- Apply all relevant optimizations
- Add inline comments explaining each decision
- Report estimated size reduction
Validate
python3 scripts/dockerfile_analyzer.py Dockerfile
/docker-development compose — Docker Compose Configuration
Identify services
- Application (web, API, worker)
- Database (postgres, mysql, redis, mongo)
- Cache (redis, memcached)
- Queue (rabbitmq, kafka)
- Reverse proxy (nginx, traefik, caddy)
Apply compose best practices
SERVICES ├── Use depends_on with condition: service_healthy ├── Add healthchecks for every service ├── Set resource limits (mem_limit, cpus) ├── Use named volumes for persistent data └── Pin image versions NETWORKING ├── Create explicit networks (don't rely on default) ├── Separate frontend and backend networks ├── Only expose ports that need external access └── Use internal: true for backend-only networks ENVIRONMENT ├── Use env_file for secrets, not inline environment ├── Never commit .env files (add to .gitignore) ├── Use variable substitution: ${VAR:-default} └── Document all required env vars DEVELOPMENT vs PRODUCTION ├── Use compose profiles or override files ├── Dev: bind mounts for hot reload, debug ports exposed ├── Prod: named volumes, no debug ports, restart: unless-stopped └── docker-compose.override.yml for dev-only configGenerate compose file
- Output docker-compose.yml with healthchecks, networks, volumes
- Generate .env.example with all required variables documented
- Add dev/prod profile annotations
/docker-development security — Container Security Audit
- **Dockerfile
Câu hỏi thường gặp
Multi-stage build là gì?
Đó là một Dockerfile dùng một stage để build ứng dụng và một stage nhỏ hơn để chạy, nên image cuối cùng gọn hơn.
Nó có kiểm tra container đang chạy được không?
Có. Lệnh bảo mật có thể rà soát một Dockerfile hoặc một container đang chạy.
Nó có giúp với docker-compose không?
Có. Nó có thể tạo hoặc cải thiện file docker-compose theo các thực hành tốt nhất.
Chi tiết
Mô tả gốc của tác giả
Use for any Dockerfile or docker-compose file to write, optimize or review, before editing it. Checks layers, caching, size and security with dockerfile_analyzer.py and validates compose files with compose_validator.py.
Độ phổ biến
- Sao GitHub
- 29k
- Vị trí xếp hạng
- #9555
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agent-launcher-orchestrator
29kGiúp agent của bạn lên kế hoạch, xây dựng, kiểm thử và lên lịch một Claude managed agent trong tài khoản riêng, từng bước một, bắt đầu từ một mục tiêu rõ ràng.
grade-iterate
29kCho phép agent của bạn chấm kết quả một managed AI agent theo bảng tiêu chí và cải thiện qua số vòng cố định, nên không bao giờ lặp vô tận.
interview
29kCho phép agent của bạn phỏng vấn bạn về ý tưởng agent AI và biến câu trả lời thành một kế hoạch xây dựng đơn giản trước khi khởi chạy bất cứ điều gì.
run-without-you
29kGiúp agent của bạn thiết lập một managed AI agent chạy theo lịch hoặc khi có sự kiện xảy ra, với thời gian cron được kiểm tra trước khi khởi chạy.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.