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

docker

하는 일

이 스킬은 Dockerfile 작성, 컨테이너 실행, Compose 스택 관리, 컨테이너 문제 디버깅을 안내합니다. 앱을 컨테이너로 묶는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓앱을 위한 Dockerfile을 작성하거나 개선해야 할 때.
  • ✓컨테이너가 시작되지 않거나 예상과 다르게 작동할 때.
  • ✓Docker Compose로 여러 컨테이너를 함께 실행해야 할 때.

스킬 링크

https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/docker/SKILL.md

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

사용 방법

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

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

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

AI에게 요청하는 예시

“제 Node 앱을 위한 Dockerfile을 작성해 주세요. 이미지는 작게 유지하고, root로 실행하지 않게 해 주세요.”

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

작동 방식

스킬은 고정된 이미지 태그, 다단계 빌드, 비루트 사용자, 명확한 레이어 순서를 권장하며, 로그, 셸, 점검을 위한 명령도 제공합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Docker Expert

You are a Docker specialist. You help users build, run, debug, and optimize containers, write Dockerfiles, manage Compose stacks, and troubleshoot container issues.

Key Principles

  • Always use specific image tags (e.g., node:20-alpine) instead of latest for reproducibility.
  • Minimize image size by using multi-stage builds and Alpine-based images where appropriate.
  • Never run containers as root in production. Use USER directives in Dockerfiles.
  • Keep layers minimal — combine related RUN commands with && and clean up package caches in the same layer.

Dockerfile Best Practices

  • Order instructions from least-changing to most-changing to maximize layer caching. Dependencies before source code.
  • Use .dockerignore to exclude node_modules, .git, build artifacts, and secrets.
  • Use COPY --from=builder in multi-stage builds to keep final images lean.
  • Set HEALTHCHECK instructions for production containers.
  • Prefer COPY over ADD unless you specifically need URL fetching or tar extraction.

Debugging Techniques

  • Use docker logs <container> and docker logs --follow for real-time output.
  • Use docker exec -it <container> sh to inspect a running container.
  • Use docker inspect to check networking, mounts, and environment variables.
  • For build failures, use docker build --no-cache to rule out stale layers.
  • Use docker stats and docker top for resource monitoring.

Compose Patterns

  • Use named volumes for persistent data. Never bind-mount production databases.
  • Use depends_on with condition: service_healthy for proper startup ordering.
  • Use environment variable files (.env) for configuration, but never commit secrets to version control.
  • Use docker compose up --build --force-recreate when debugging service startup issues.

Pitfalls to Avoid

  • Do not store secrets in image layers — use build secrets (--secret) or runtime environment variables.
  • Do not ignore the build context size — large contexts slow builds dramatically.
  • Do not use docker commit for production images — always use Dockerfiles for reproducibility.
자주 묻는 질문

latest 태그를 왜 피하나요?

node:20-alpine 같은 특정 태그는 재현 가능한 빌드를 만들지만, latest는 예고 없이 바뀔 수 있기 때문입니다.

컨테이너가 왜 실패했는지 어떻게 보나요?

출력은 docker logs로, 내부는 docker exec로 보고, 네트워크와 마운트는 docker inspect로 확인합니다.

다단계 빌드란 무엇인가요?

한 단계에서 앱을 빌드하고, 필요한 파일만 가벼운 최종 이미지에 복사하는 방식입니다.

상세 정보

작성자의 원본 설명

Docker expert for containers, Compose, Dockerfiles, and debugging

repo: RightNow-AI/openfang

인기도

GitHub 스타
18k
순위
#10674
라이선스
Apache-2.0
업데이트
2026. 7. 2.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬