docker-expert
Skill5 starsChanged 3 months agoMITView on GitHub
Use when working with Dockerfile, docker-compose.yml, .dockerignore, or multi-stage builds. Build, debug, secure, and optimize Docker 27+ images and Docker Compose services.
12 other projects use a version of this.
Adopted by
Most recently taken up by
- MortuisVMain/ai-agent-superpowerstheir own version, first seen Sep 15, 2026
- TheHiddenDeveloper/jarvis-skillstheir own version, first seen Aug 19, 2026
- dallay/agents-skillstheir own version, first seen Aug 13, 2026
- ElyzeSolutions/skillstheir own version, first seen Aug 6, 2026
- jshsakura/awesome-opencode-skillstheir own version, first seen Jul 8, 2026
- FilippoDeSilva/skillstheir own version, first seen Jun 26, 2026
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- vmDeshpande/ai-agent-automation★ 178same name
- jshsakura/awesome-opencode-skills★ 29same name
- Fandry96/k3-agentic-skills★ 27same name
- xfstudio/skills★ 9same name
- xcrrr/claude-skills★ 6same name
- k1lgor/virtual-company★ 4same name
- ai4brands-design/claude-skills★ 2same name
- dallay/agents-skills★ 2same name
- FilippoDeSilva/skills★ 2same name
- ElyzeSolutions/skills★ 1same name
2 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- engineering-rulesSkill
- fastapi-expertSkill
- fastify-expertSkill
- flutter-expertSkill
- go-expertSkill
- jetpack-compose-expertSkill
- mobile-qa-expertSkill
- nestjs-expertSkill
- playwright-expertSkill
- react-expertSkill
- react-native-expertSkill
- remix-expertSkill
- swiftui-expertSkill
- terraform-expertSkill
- vue-expertSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 5 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 12 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 34
Verify the image build: - run docker build --progress=plain -t app:local ..
- Very specific: line 36
Run the container: - run docker run --rm --name app-local -p 8080:8080 app:local, replacing 8080 with the real application port.
- Distinctive: line 38
Implement Compose configuration when needed: - use Compose for multi-service applications or local development.
- Very specific: line 40
Verify Compose configuration: - run docker compose config.
- Very specific: line 42
Harden the final image: - run as an unprivileged user, avoid latest tags, do not copy secrets into the image, and add a health check for …
- Distinctive: line 56
Use multi-stage builds so compilers, source code, and development dependencies do not ship in the runtime image:
- Distinctive: line 93
Wait for healthy dependencies in Compose instead of treating container startup as readiness:
- Distinctive: line 113
Copying source before installing dependencies: - every source change invalidates dependency layers.
- Distinctive: line 115
Running as root: - create and use an unprivileged runtime user.
“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Docker Expert
Build small, reproducible, non-root Docker images using Docker 27+ and BuildKit.
When to Use This Skill
- Creating or changing a
Dockerfile - Creating or debugging a
docker-compose.ymlorcompose.yaml - Converting a single-stage image into a multi-stage production image
- Improving Docker build cache behavior or BuildKit usage
- Adding
.dockerignore, health checks, or non-root execution - Diagnosing Docker image-size, startup, networking, volume, or Compose issues
Core Workflow
- Inspect the runtime contract - identify the app start command, listening port, required files, environment variables, native dependencies, and health endpoint. Read existing Dockerfiles, Compose files, lockfiles, and
.dockerignorebefore making changes. - Design build and runtime stages - separate build dependencies from runtime dependencies. Pin an explicit maintained base-image version, use named build stages, and copy only required runtime artifacts into the final image.
- Implement Dockerfile and ignore rules - order layers from least frequently changed to most frequently changed: base image, OS packages, dependency manifests, dependency installation, then application source. Add
.dockerignorebefore relying onCOPY . .. - Verify the image build - run
docker build --progress=plain -t app:local .; fix every reported issue and re-run until clean. Change only an application source file, rebuild, and confirm dependency installation is cached. - Run the container - run
docker run --rm --name app-local -p 8080:8080 app:local, replacing8080with the real application port. Check logs withdocker logs app-local, verify the endpoint, fix failures, and re-run until clean. - Implement Compose configuration when needed - use Compose for multi-service applications or local development. Define explicit services, ports, networks, volumes, health checks, and dependency readiness.
- Verify Compose configuration - run
docker compose config; fix every reported issue and re-run until clean. Then rundocker compose up --build --wait, inspectdocker compose psanddocker compose logs, verify the application endpoint, and rundocker compose down --volumesafter testing. - Harden the final image - run as an unprivileged user, avoid
latesttags, do not copy secrets into the image, and add a health check for long-running HTTP services. Rundocker image inspect app:local; fix identified security or runtime problems and re-run until clean.
Reference Guide
Load detailed guidance only when the task needs it:
| Topic | Reference | Load When |
| Production Dockerfiles | references/production-dockerfiles.md | Creating, optimizing, or reviewing a Dockerfile |
| Compose development | references/compose-development.md | Working with Compose services, volumes, networks, or local dependencies |
| Security and health checks | references/security-healthchecks.md | Hardening an image, handling secrets, or adding health checks |
Key Patterns
Use multi-stage builds so compilers, source code, and development dependencies do not ship in the runtime image:
# syntax=docker/dockerfile:1.7
FROM node:22-bookworm-slim AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN --mount=type=cache,target=/root/.npm npm ci
COPY . .
RUN npm run build
FROM node:22-bookworm-slim AS runtime
WORKDIR /app
ENV NODE_ENV=production
RUN groupadd --system app && useradd --system --gid app app
COPY package.json package-lock.json ./
RUN --mount=type=cache,target=/root/.npm npm ci --omit=dev
COPY --from=build /app/dist ./dist
USER app
EXPOSE 8080
CMD ["node", "dist/server.js"]Copy lockfiles before application source so dependency installation remains cached:
COPY package.json package-lock.json ./
RUN --mount=type=cache,target=/root/.npm npm ci
COPY . .Wait for healthy dependencies in Compose instead of treating container startup as readiness:
services:
api:
build: .
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://localhost:8080/health').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10sCommon Mistakes
- Using a single-stage image - build tools, source files, and development dependencies ship to production. Use a separate build stage and minimal runtime stage.
- Copying source before installing dependencies - every source change invalidates dependency layers. Copy lockfiles first, install dependencies, then copy source.
- Using
latestimage tags - builds are not reproducible. Use an explicit maintained tag such asnode:22-bookworm-slim. - Running as root - create and use an unprivileged runtime user.
- Missing
.dockerignore- build contexts can includenode_modules, Git history, test output, and secrets. Exclude files that are not needed. - Using
depends_onas readiness - startup order does not prove the dependency is ready. Define health checks and usecondition: service_healthy.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

