본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)29k · #9555

docker-development

하는 일

이 스킬은 Docker 컨테이너 설정을 작성하고, 최적화하고, 검토하도록 안내합니다. 빨리 빌드되고, 크기가 작고, 안전하게 실행되는 컨테이너를 원하는 개발자에게 맞습니다.

사용하는 경우

  • ✓Docker 빌드가 느리거나 이미지가 너무 클 때.
  • ✓프로젝트를 위해 docker-compose 파일을 설정하고 싶을 때.
  • ✓배포하기 전에 Dockerfile에 보안 문제가 있는지 확인하고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/alirezarezvani/claude-skills/blob/main/engineering/docker-development/skills/docker-development/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“Docker 이미지가 너무 크고 빌드가 느립니다. 크기와 캐싱에 맞게 Dockerfile을 최적화해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 Dockerfile의 레이어, 캐시, 크기를 분석한 뒤 멀티 스테이지 빌드 같은 변경을 제안합니다. compose 파일도 검증하고, Dockerfile이나 실행 중인 컨테이너의 보안 문제를 점검합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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
자주 묻는 질문

멀티 스테이지 빌드란 무엇인가요?

앱을 빌드하는 단계와 실행하는 더 작은 단계를 나눈 Dockerfile입니다. 최종 이미지가 더 가벼워집니다.

실행 중인 컨테이너도 점검할 수 있나요?

네. 보안 명령으로 Dockerfile이나 실행 중인 컨테이너를 점검할 수 있습니다.

docker-compose에도 도움이 되나요?

네. 모범 사례를 따르는 docker-compose 파일을 만들거나 개선할 수 있습니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
29k
순위
#9555
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬