Docker Patterns

Use when the user asks to write a Dockerfile, a multi-stage Dockerfile for a Node, Python or Go service, Docker Compose, .dockerignore, non-root containers, layer caching, BuildKit cache mounts, or image healthchecks. Produces small, secure Dockerfiles and Compose files. Not for container internals like cgroups (use docker-internals) or Kubernetes manifests (use cloud-native-kubernetes-patterns).

45 stars 6 forksDevOps & Cloud

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add j4flmao/agent-skills --skill docker-patterns
Manual install
git clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills/skills/devops/docker-patterns ~/.claude/skills/docker-patterns

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Docker Patterns

## Purpose
Containerize applications following Docker best practices for development and production.

## Agent Protocol

### Trigger
Exact user phrases: "Dockerfile", "Docker", "Docker Compose", "containerize", "container", "docker build", "multi-stage build", "docker-compose.yml".

### Input Context
- Application stack (for base image selection).
- Build tooling (for layer caching strategy).
- Deployment target (for production vs dev separation).
- Language-specific build requirements (compilers, system deps).

### Output Artifact
Writes to Dockerfile, .dockerignore, and/or docker-compose.yml.

### Response Format
Dockerfile or docker-compose.yml with comments explaining each section.

No preamble. No postamble. No explanations. No filler/hedging/transitions.

### Completion Criteria
- Multi-stage build is implemented (builder + runner).
- Non-root user is configured.
- .dockerignore exists.
- Layer caching is optimized (dependency files copied first).
- Health check is configured.
- Production vs development separation is handled.

## Architecture / Decision Trees

### Base Image Selection

| Base Image | Size | Security Surface | Use Case |
|---|---|---|---|
| alpine | ~5MB | Minimal (musl libc) | Go, Rust, static binaries |
| slim (debian) | ~80MB | Reduced (glibc) | Node, Python, Ruby |
| distroless | ~15MB | Minimal (no shell) | Production, security-hardened |
| ubuntu/debian | ~200MB | Full (apt, tools) | Development, complex deps |
Read the full skill on GitHub

Details

Skill name
docker-patterns
Path
skills/devops/docker-patterns/SKILL.md
License
MIT
Repo updated
17 November 2026

FAQ

What does the Docker Patterns skill do?

Use when the user asks to write a Dockerfile, a multi-stage Dockerfile for a Node, Python or Go service, Docker Compose, .dockerignore, non-root containers, layer caching, BuildKit cache mounts, or image healthchecks. Produces small, secure Dockerfiles and Compose files. Not for container internals like cgroups (use docker-internals) or Kubernetes manifests (use cloud-native-kubernetes-patterns).

How do I install the Docker Patterns skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add j4flmao/agent-skills --skill docker-patterns. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Docker Patterns popular?

It lives in j4flmao/agent-skills, which has 45 GitHub stars and 6 forks.

Related skills

Agent Observability

45

j4flmao/agent-skills

Use when the user asks about agent observability, tracing agent reasoning, debugging an agent loop, OpenTelemetry GenAI spans for LLM calls, LLM cost tracking per agent, agent audit logs or hallucination/eval monitoring in production. Produces instrumentation config, trace schema, dashboards, alerts and cost attribution. Not for generic service tracing without LLMs (use devops-opentelemetry).

DevOps & Cloud

AI Agent Architectures

45

j4flmao/agent-skills

Use when the user asks to build an AI agent, design an agent that calls tools and keeps memory, write an agent system prompt or pick an agent framework (Claude Agent SDK, OpenAI Agents SDK, LangGraph). Produces an architecture brief covering loop, tools, memory, guardrails and evals, routing depth to child skills. Not for workflow patterns (use ai-agentic-workflows).

AI, LLMs & Agents

AI Agent Core Loop

45

j4flmao/agent-skills

Use when the user asks about the agent loop, ReAct vs plan-and-solve, re-planning, Reflexion, an agent stuck in a loop, max iterations or termination conditions. Produces a loop spec or patch with state, success predicate, caps and no-progress detection. Not for overall agent design (use ai-agent-architectures) or tool schemas (use tool-calling-principles).

AI, LLMs & Agents

Enterprise Cost Governance

45

j4flmao/agent-skills

Use when the user asks about cloud cost governance: tagging policy, cost allocation, showback or chargeback, budgets and alerts, cost anomaly detection or unit cost reporting. Produces a cost governance model with owners and controls. Not for hands-on cloud cost optimization (use devops-finops) or capacity forecasts (use enterprise-capacity-planning).

DevOps & Cloud

Docker Internals

45

j4flmao/agent-skills

Use when the user asks how containers work, Linux namespaces and cgroups v2, OverlayFS layers and copy-on-write, containerd and runc, the OCI runtime spec, container PID 1 and signals, or why a container is OOM killed. Explains container primitives for debugging and hardening. Not for Dockerfile authoring (use docker-patterns) or image scanning (use security-container-security).

DevOps & Cloud

Enterprise Itil Service Mgmt

45

j4flmao/agent-skills

Use when the user asks about ITIL 4, ITSM, service desk, incident, problem and change management practices, CAB, service catalog or service level management. Produces ITIL practice design and process flows. Not for on-call engineering incident response (use devops-incident-response) or SLO math (use enterprise-sla-management).

DevOps & Cloud

Browse the most popular Claude skills, all devops & cloud skills, or write your own with the skills generator.