docker-expert

docker-expert is a skill for Claude Code, Codex from hoangatg/ai-agent-toolkit. It costs 35 tokens per session (867 once invoked), scanned A, original, MIT.

A guide to packaging applications in Docker containers, including multi-stage builds, Docker Compose, image size, and security settings.

In plain words
What is it for?
Use it when containerizing an application, writing or improving a Dockerfile, coordinating services with Compose, choosing a base image, or hardening a container.
Why use it?
It helps reduce oversized images, unnecessary files, slow builds, and avoidable container security risks.

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/hoangatg/ai-agent-toolkit/docker-expert
Any agent
npx skills add hoangatg/ai-agent-toolkit --skill docker-expert
Clone the repo
git clone --depth 1 https://github.com/hoangatg/ai-agent-toolkit

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/hoangatg/ai-agent-toolkit/docker-expert.svg)](https://agentmods.dev/skills/hoangatg/ai-agent-toolkit/docker-expert)
Your own site
<a href="https://agentmods.dev/skills/hoangatg/ai-agent-toolkit/docker-expert"><img src="https://agentmods.dev/badge/skills/hoangatg/ai-agent-toolkit/docker-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 867 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.1 $0.00035 $0.00867
Opus 5 $0.00017 $0.00434
Sonnet 5 $0.00007 $0.00173
Haiku 4.5 $0.00003 $0.00087

Measured yesterday against content hash 7a02bc44a98d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

docker-expert 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 yesterday.

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.

Asks for rootlowPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

| Run as root | Create non-root user |

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

.agent/skills/docker-expert/SKILL.md · 135 lines

How it starts

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

Docker Expert

Containers should be small, fast, and secure. Everything else is configuration.


1. Dockerfile Principles

Multi-Stage Build Pattern

Stage 1: Build (heavy, all dependencies)
  └── Compile, test, build artifacts
Stage 2: Production (minimal, runtime only)
  └── Copy artifacts, set entrypoint

Layer Optimization

Principle Application
Order matters Least-changing layers first
Combine RUN Reduce layers with &&
Clean up Remove cache/temp in same layer
Use .dockerignore Exclude node_modules, .git, etc.

Base Image Selection

Need Image Size
Minimal alpine, distroless 5-50MB
Standard slim variants 50-200MB
Full bullseye, bookworm 200MB+
Specific runtime node:20-alpine, python:3.12-slim Varies

2. Image Size Optimization

Size Reduction Checklist

Technique Impact
Multi-stage builds 50-90% reduction
Alpine/slim base 60-80% reduction
.dockerignore Varies (often 50%+)
Remove dev dependencies 20-40% reduction
Combine and clean RUN layers 10-30% reduction

3. Docker Compose Patterns

Service Design

Principle Application
One process per container Don't run nginx + app together
Named volumes Persist data explicitly
Health checks Define liveness probes
Dependency order depends_on with conditions
Environment files .env for secrets (not committed)

Networking

Network Type Use Case
Bridge Default, container-to-container
Host Performance-critical, no isolation
Overlay Multi-host (Swarm/K8s)
None Maximum isolation

4. Security Hardening

Container Security

Practice Why
Non-root user Limit blast radius
Read-only filesystem Prevent tampering
No new privileges Block privilege escalation
Scan images Detect known CVEs
Pin versions Reproducible builds

Read the full file on GitHub · 135 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. yesterday First seen · 135 lines · 35 tokens per session scan A 7a02bc44a98d

Subscribe to this mod's changes

docker-expert is a skill published in the GitHub repository hoangatg/ai-agent-toolkit (1 stars, last pushed 5mo ago), licensed MIT. It adds 35 tokens to every session and 867 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.