docker-conventions

docker-conventions is a skill for Claude Code from andr-ca/agentharness. It costs 47 tokens per session (1,242 once invoked), scanned B, original, MIT.

A set of guidelines for writing Dockerfiles, Docker Compose files, and CI container configurations. Docker packages an application and its dependencies so it can run consistently in different environments.

In plain words
What is it for?
Use it when creating or reviewing container builds, including base image choices, build stages, caching, non-root users, secrets, and health checks.
Why use it?
It helps avoid oversized, insecure, slow-to-build, or difficult-to-maintain container configurations.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it when creating or reviewing container builds, including base image choices, build stages, caching, non-root users, secrets, and health checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/andr-ca/agentharness/docker-conventions
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 andr-ca/agentharness --skill docker-conventions
Clone the repo
git clone --depth 1 https://github.com/andr-ca/agentharness

Made for: Claude Code.

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-conventions

README.md
[![agentmods](https://agentmods.dev/badge/skills/andr-ca/agentharness/docker-conventions/github.svg)](https://agentmods.dev/skills/andr-ca/agentharness/docker-conventions)
Your own site
<a href="https://agentmods.dev/skills/andr-ca/agentharness/docker-conventions"><img src="https://agentmods.dev/badge/skills/andr-ca/agentharness/docker-conventions/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-conventions

Your own site · 80×15
<a href="https://agentmods.dev/skills/andr-ca/agentharness/docker-conventions"><img src="https://agentmods.dev/badge/skills/andr-ca/agentharness/docker-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,242 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. 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.00047 $0.01242
Opus 5.5 $0.00019 $0.00497
Sonnet 5.5 $0.00009 $0.00248
Haiku 4.5 $0.00005 $0.00124

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

Security

Grade B, and why

docker-conventions scanned grade B with 2 findings 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 1mo 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.

Recursive force deletemediumDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

packages: `apt-get install -y ... && rm -rf /var/lib/apt/lists/*`

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Makes network callslowCapability

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

- Don't install `curl`, `wget`, or debugging tools in production images.
.claude/skills/docker-conventions/SKILL.md · 193 lines

How it starts

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

Docker Conventions

Best practices for Dockerfiles and container configurations. Focus areas: image size, build cache efficiency, security, and production readiness.


Base images

  • Use official images with a pinned version tag: python:3.12-slim, node:22-alpine, golang:1.24-alpine.
  • Prefer slim (Debian-based, small) or alpine (even smaller, musl libc) variants. Avoid latest — it changes without notice.
  • For production, prefer distroless or scratch (Go static binaries) to minimise the attack surface.
# Good: specific version, minimal base
FROM python:3.12-slim

# Bad: unpinned, full Debian base
FROM python:latest

Multi-stage builds

Use multi-stage builds to keep the production image small — the build tools (compilers, test runners, dev dependencies) stay in the build stage and never reach the final image.

# Stage 1: build
FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

# Stage 2: production
FROM node:22-alpine AS production
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
EXPOSE 3000
USER node
CMD ["node", "dist/index.js"]

Layer caching

Docker caches layers until a layer (or one of its inputs) changes. Copy dependency files before source code so the dependency install step is cached across code-only changes.

# Good: dependency install cached when only code changes
COPY package*.json ./
RUN npm ci
COPY . .         # ← only invalidates layers from here down

# Bad: copies all source first — dependency install re-runs on every code change
COPY . .
RUN npm install

Security

Never embed secrets in a Dockerfile or in a layer. Secrets baked into a layer remain accessible in the image history even if deleted in a later layer.

# WRONG: secret in a layer (visible via `docker history`)
RUN echo "API_KEY=abc123" > /app/.env

# RIGHT: pass secrets at runtime via environment variable or a secret mount
# docker run -e API_KEY=$API_KEY ...
# or use BuildKit secrets for build-time:
RUN --mount=type=secret,id=api_key cat /run/secrets/api_key > /tmp/key

Read the full file on GitHub · 193 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. 1mo ago First seen · 193 lines · 47 tokens per session scan B 210a0b9e3b77

Subscribe to this mod's changes

docker-conventions is a skill published in the GitHub repository andr-ca/agentharness (1 stars, last pushed 2d ago), licensed MIT. It adds 47 tokens to every session and 1,242 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it B with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

wicked-garden-platform-security-engineer

Security scanning and vulnerability assessment from DevSecOps perspective. Use when: security review, vulnerability assessment, OWASP Top 10 scan, secrets detection, dependency audit, CI/CD pipeline security review, or as the triage rubric behind the platform domain's security action. NOT THIS WHEN: a scenario-driven…

mikeparcewski/wicked-garden · 145 tokens

supply-chain-and-dependency-review

Use when the diff adds, upgrades, re-sources or re-pins a dependency - manifests, lockfiles, go.mod replace, Docker base images, GitHub Actions uses, Terraform modules, submodules, vendored or generated code, curl-pipe-sh installs - or changes what goes into a package or image, how releases are signed and verified, or…

makifbaysal/tasktrooper · 90 tokens

ci-debug-workflow

Debug failing CI pipelines, containers, and reproduce bugs locally. Use when CI is red, containers won't start, or need to reproduce bugs.

spences10/skills · 33 tokens

deployment-patterns

Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications. Use when setting up deployment infrastructure or planning releases.

affaan-m/ECC · 41 tokens

cdf-orchestration-setup

Use when the user asks to deploy, install, reinstall, redeploy, upgrade, or connect to the CDF Orchestration Airflow controller. Owns the end-to-end deploy sequence and runs the cdf-orchestration-preflight audit first. Covers make setup, controller image builds, Helm installation, controller connection…

NVIDIA/skills · 105 tokens

doca-argus

Use this skill when the user is deploying or operating the DOCA Argus Service — the packaged BlueField-side runtime-security container that watches the BlueField and attached host for suspicious activity, integrity violations, and operational anomalies, and forwards findings to a SIEM (Splunk / ELK / Sentinel /…

NVIDIA/skills · 213 tokens