devops-docker-patterns

A guide to running software in Docker containers, including Dockerfiles and Docker Compose configurations. Docker packages an application with the files and tools it needs to run consistently.

In plain words
What is it for?
Use it when creating or improving multi-stage Dockerfiles, Compose environments, build caching, health checks, resource limits, and container security.
Why use it?
It helps address large images, slow builds, insecure containers, and inconsistent development or production setups.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ai-shell-team/aish/devops-docker-patterns
Any agent
npx skills add AI-Shell-Team/aish --skill devops-docker-patterns
Clone the repo
git clone --depth 1 https://github.com/AI-Shell-Team/aish

Made for: Claude Code, Codex.

Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,010 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00043 $0.01010
Opus 5 $0.00022 $0.00505
Sonnet 5 $0.00009 $0.00202
Haiku 4.5 $0.00004 $0.00101

Measured 2d ago against content hash 06eb6052199d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

devops-docker-patterns scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

CMD wget -qO- http://localhost:3000/health || exit 1
skills/devops-docker-patterns/SKILL.md · 151 lines

How it starts

The opening of the file, as written. The whole thing — 151 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Docker Patterns Expert

Senior DevOps engineer specializing in Docker containerization, multi-stage builds, and production container patterns.

Role Definition

You are a Docker expert with deep experience in:

  • Multi-stage Builds: Optimizing build and runtime stages
  • Image Optimization: Minimizing image size, layer caching
  • Container Security: Non-root users, secrets management, scanning
  • Docker Compose: Development and production orchestration
  • BuildKit: Advanced build features, cache mounting

When to Use This Skill

  • Writing or optimizing Dockerfiles for production
  • Setting up Docker Compose for development environments
  • Implementing multi-stage builds for size optimization
  • Configuring container security best practices
  • Setting up health checks and resource limits

Core Patterns

Multi-stage Dockerfile (Node.js)

# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
# Install full deps (including devDependencies) — `npm run build` needs them.
# Production-only prune happens in the runner stage below.
RUN npm ci && npm cache clean --force
COPY . .
RUN npm run build

# Production stage
FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
COPY --from=builder --chown=nodejs:nodejs /app/dist ./dist
COPY --from=builder --chown=nodejs:nodejs /app/node_modules ./node_modules
USER nodejs
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s \
  CMD wget -qO- http://localhost:3000/health || exit 1
CMD ["node", "dist/main.js"]

Docker Compose (Development)

version: '3.8'
services:
  app:
    build:
      context: .
      target: builder
    volumes:
      - .:/app
      - /app/node_modules
    ports:
      - "3000:3000"
    environment:
      - DATABASE_URL=postgres://user:pass@db:5432/app
    depends_on:
      db:
        condition: service_healthy
  db:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: user
      POSTGRES_PASSWORD: pass
      POSTGRES_DB: app
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U user -d app"]
      interval: 5s
      timeout: 5s
      retries: 5

Read the full file on GitHub · 151 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 151 lines · 43 tokens per session scan A 06eb6052199d

Subscribe to this mod's changes

devops-docker-patterns is a skill published in the GitHub repository AI-Shell-Team/aish (522 stars, last pushed 6d ago), licensed Apache-2.0. It adds 43 tokens to every session and 1,010 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

taskgo

Maintains a private Git-backed personal project and task control repository using concise current Markdown, derived Git history, ADRs, and status synchronization. Use when tracking tasks, updating project status (STATUS.md), managing ADRs, synchronizing tracker state, or delegating tasks to external agents across…

ithinkihaveacat/dotfiles · 62 tokens

mbo-plan

Plan a new objective end-to-end in this repo's docs/mbo Management-By-Objective system — turn a GitHub issue or a gss draft-PR worktree into consistent design/spec/plan artifacts and track it in docs/mbo/index.md. Use this whenever the user wants to START planning or designing a new feature, skill, CLI, or service…

sfc-gh-eraigosa/dotfiles · 260 tokens

wear-widget

Workflows, checklists, and scripts for reverse-engineering, analyzing, and extracting Wear OS and Android widgets (Glance, AppWidget, ProtoLayout Tiles). Covers manifest declarations, XML configurations, preview asset extraction, and AVD rendering. Use when analyzing APK widget features, extracting widget…

ithinkihaveacat/dotfiles · 81 tokens

jetpack

Looks up AndroidX and Jetpack library facts that change between releases: current artifact versions (ALPHA, BETA, RC, STABLE, SNAPSHOT, build IDs), Maven coordinates for classes/packages, direct dependencies, and published source code. Use when looking up AndroidX/Jetpack library versions, finding Maven coordinates…

ithinkihaveacat/dotfiles · 98 tokens

emumanager

Manages Android SDKs, system images, emulators, and Android Virtual Devices (AVDs). Provides workflows for bootstrapping the SDK, downloading images, and creating, starting, or stopping AVDs across mobile, Wear OS, TV, and Automotive form factors. Use when setting up Android SDK tools, launching or debugging…

ithinkihaveacat/dotfiles · 84 tokens

agent-review

Conducts independent, read-only code reviews of branches, diffs, commits, working trees, or pull requests using external CLI agents (Codex, Claude, agy) or a synthesized review workflow. Focuses strictly on actionable defects and evidence-based findings. Use when reviewing code changes, requesting a second opinion on…

ithinkihaveacat/dotfiles · 91 tokens