Docker containers, images, Compose stacks, networking, volumes, debugging, production hardening, and the commands that keep real environments stable. Use when (1) the task touches Docker, Dockerfiles, images, containers, or Compose; (2) build reliability, runtime behavior, logs, ports, volumes, or security matter; (3) the agent needs Docker guidance and should apply it by default.
설치
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Docker containers, images, Compose stacks, networking, volumes, debugging, production hardening, and the commands that keep real environments stable. Use when (1) the task touches Docker, Dockerfiles, images, containers, or Compose; (2) build reliability, runtime behavior, logs, ports, volumes, or security matter; (3) the agent needs Docker guidance and should apply it by default.
changelog
Simplified the skill name and kept the stateless activation guidance
Use when the task involves Docker, Dockerfiles, container builds, Compose, image publishing, networking, volumes, logs, debugging, or production container operations. This skill is stateless and should be applied directly whenever Docker work appears.
Core Rules
1. Pin Image Versions
python:3.11.5-slim not python:latest
Today's latest differs from tomorrow's — breaks immutable builds
2. Combine RUN Commands
apt-get update && apt-get install -y pkg in ONE layer
Separate layers = stale package cache weeks later
3. Non-Root by Default
Add USER nonroot in Dockerfile
Running as root fails security scans and platform policies
4. Set Resource Limits
-m 512m on every container
OOM killer strikes without warning otherwise
5. Configure Log Rotation
Default json-file driver has no size limit
One chatty container fills disk and crashes host
Image Traps
Multi-stage builds: forgotten --from=builder copies from wrong stage silently
COPY before RUN invalidates cache on every file change — copy requirements first, install, then copy code
ADD extracts archives automatically — use COPY unless you need extraction
Build args visible in image history — never use for secrets
Runtime Traps
localhost inside container is container's localhost — bind to 0.0.0.0
Port already in use: previous container still stopping — wait or force remove