docker-best-practices

docker-best-practices is a skill for Claude Code, Codex from Global-mindee/WAY. It costs 22 tokens per session (1,011 once invoked), scanned A, original, MIT.

A guide to building and securing Docker images, packages that contain an application and its runtime dependencies. It covers multi-stage builds, Compose, image size, health checks, and non-root users.

In plain words
What is it for?
Use it to write Dockerfiles, define multi-container setups, separate build and runtime files, add health checks, and run applications as non-root users.
Why use it?
It helps produce smaller runtime images and reduces avoidable security and deployment problems.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to write Dockerfiles, define multi-container setups, separate build and runtime files, add health checks, and run applications as non-root users.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/global-mindee/way/docker-best-practices
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.

Any agent
npx skills add Global-mindee/WAY --skill docker-best-practices
Clone the repo
git clone --depth 1 https://github.com/Global-mindee/WAY

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for docker-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/global-mindee/way/docker-best-practices/github.svg)](https://agentmods.dev/skills/global-mindee/way/docker-best-practices)
Your own site
<a href="https://agentmods.dev/skills/global-mindee/way/docker-best-practices"><img src="https://agentmods.dev/badge/skills/global-mindee/way/docker-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for docker-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/global-mindee/way/docker-best-practices"><img src="https://agentmods.dev/badge/skills/global-mindee/way/docker-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,011 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00022 $0.01011
Opus 5.5 $0.00009 $0.00404
Sonnet 5.5 $0.00004 $0.00202
Haiku 4.5 $0.00002 $0.00101

Measured 3mo ago against content hash 61f9afe23a57, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

docker-best-practices 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 3mo 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.

HEALTHCHECK --interval=30s --timeout=3s CMD wget -qO- http://localhost:3000/healthz || exit 1
skills/04_infra-platform/docker-best-practices/SKILL.md · 153 lines

How it starts

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

Docker Best Practices

Multi-Stage Build

FROM node:22-alpine AS deps
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --only=production

FROM node:22-alpine AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM node:22-alpine AS runtime
WORKDIR /app
RUN addgroup -g 1001 -S appgroup && adduser -S appuser -u 1001 -G appgroup
COPY --from=deps /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
COPY --from=build /app/package.json ./
USER appuser
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=3s CMD wget -qO- http://localhost:3000/healthz || exit 1
CMD ["node", "dist/server.js"]

Separate dependency installation from build steps. Final stage contains only runtime artifacts.

Python Multi-Stage

FROM python:3.12-slim AS builder
WORKDIR /app
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

FROM python:3.12-slim
WORKDIR /app
RUN useradd --create-home appuser
COPY --from=builder /opt/venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
COPY . .
USER appuser
CMD ["gunicorn", "app:create_app()", "-b", "0.0.0.0:8000", "-w", "4"]

Docker Compose

services:
  api:
    build:
      context: .
      dockerfile: Dockerfile
      target: runtime
    ports:
      - "3000:3000"
    environment:
      - DATABASE_URL=postgres://user:pass@db:5432/app
      - REDIS_URL=redis://cache:6379
    depends_on:
      db:
        condition: service_healthy
      cache:
        condition: service_started
    restart: unless-stopped
    deploy:
      resources:
        limits:
          memory: 512M

  db:
    image: postgres:16-alpine
    volumes:
      - pgdata:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: app
      POSTGRES_USER: user
      POSTGRES_PASSWORD: pass
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U user -d app"]
      interval: 5s
      timeout: 3s
      retries: 5

  cache:
    image: redis:7-alpine
    command: redis-server --maxmemory 128mb --maxmemory-policy allkeys-lru

volumes:
  pgdata:

Read the full file on GitHub · 153 lines

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. 3mo ago First seen · 153 lines · 22 tokens per session scan A 61f9afe23a57

Subscribe to this mod's changes

docker-best-practices is a skill published in the GitHub repository Global-mindee/WAY (11 stars, last pushed 2mo ago), licensed MIT. It adds 22 tokens to every session and 1,011 once invoked, about $0.0001 per session on Opus 5.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-09-03.

Related

docker-best-practices compared with skills from other repositories

docker-best-practices next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
docker-best-practicesGlobal-mindee/WAYSkill112mo agoMITA22Claude Code, Codex
Cortexdanielmiessler/LifeOSSkill21k14d agoMITA184Claude Code
Musicdanielmiessler/LifeOSSkill21k14d agoMITA128Claude Code, Codex
deploy-docker-composeomnigent-ai/omnigentSkill12ktodayApache-2.0A84Claude Code, Codex
bdd-container-updateNVIDIA-AI-Blueprints/video-search-and-summarizationSkill2.0ktodayApache-2.0A117Cursor
detecting-privilege-escalation-in-kubernetes-podsxalgorix/xalgorixSkill1.6ktodayApache-2.0A40Claude Code, Codex
docker-socket-mountPurpleAILAB/DecepticonSkill6.9k13d agoApache-2.0B67Claude Code