Langsung ke konten
Skillpedia
Deploy & cloud (DevOps)29k ยท #9555

docker-development

Fungsinya

Skill ini memandu agent menulis, mengoptimalkan, dan meninjau pengaturan container Docker. Skill ini untuk pengembang yang menginginkan container yang cepat dibangun, berukuran kecil, dan aman dijalankan.

Kapan dipakai

  • โœ“Saat build Docker Anda lambat atau image Anda terlalu besar.
  • โœ“Saat Anda ingin menyiapkan file docker-compose untuk sebuah proyek.
  • โœ“Saat Anda ingin memeriksa Dockerfile dari masalah keamanan sebelum rilis.

Link skill

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/docker-development/skills/docker-development/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/alirezarezvani/claude-skills/blob/main/engineering/docker-development/skills/docker-development/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit โ†’

Contoh permintaan ke AI

โ€œImage Docker saya terlalu besar dan build-nya lambat. Optimalkan Dockerfile untuk ukuran dan caching.โ€

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent menganalisis layer, cache, dan ukuran Dockerfile, lalu menyarankan perubahan seperti multi-stage build. Agent juga memvalidasi file compose dan mengaudit masalah keamanan pada Dockerfile atau container yang berjalan.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

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

  1. 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
  2. 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 deps
    
  3. Generate optimized Dockerfile

    • Apply all relevant optimizations
    • Add inline comments explaining each decision
    • Report estimated size reduction
  4. Validate

    python3 scripts/dockerfile_analyzer.py Dockerfile
    

/docker-development compose โ€” Docker Compose Configuration

  1. Identify services

    • Application (web, API, worker)
    • Database (postgres, mysql, redis, mongo)
    • Cache (redis, memcached)
    • Queue (rabbitmq, kafka)
    • Reverse proxy (nginx, traefik, caddy)
  2. 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 config
    
  3. Generate 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

  1. **Dockerfile
Pertanyaan umum

Apa itu multi-stage build?

Yaitu Dockerfile yang memakai satu tahap untuk membangun aplikasi dan tahap yang lebih kecil untuk menjalankannya, sehingga image akhirnya lebih ringan.

Bisakah skill memeriksa container yang sedang berjalan?

Bisa. Perintah keamanan dapat mengaudit Dockerfile atau container yang berjalan.

Apakah skill membantu docker-compose?

Ya. Skill dapat membuat atau memperbaiki file docker-compose dengan praktik terbaik.

Detail

Deskripsi asli dari pembuat

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.

repo: alirezarezvani/claude-skills

Popularitas

Bintang GitHub
29k
Peringkat
#9555
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • โ€ฆ

Skill lain dari repositori ini

Skill serupa