docker-development
Skill275 starsChanged 35 days agoMITView on GitHub
Use when working with ANY Docker task: writing Dockerfiles, configuring docker-compose/compose.yml, multi-stage builds, docker-bake.hcl, container security audits, .dockerignore optimization, or CI/CD container testing. Triggers on: Dockerfile, docker-compose, container, image build, multi-stage, docker bake, compose.
- Reads credentials
- Deletes or force-pushes
- Installs packages
8 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- darkweb19/skillstheir own version, first seen Nov 8, 2026
- netresearch/docker-development-skilledited, first seen Oct 30, 2026
- JMBeresford/retromedited, first seen Oct 8, 2026
- Hassaan146/claude-skillstheir own version, first seen Jul 25, 2026
- mahiunfiltered/claude-code-skillstheir own version, first seen Jul 8, 2026
- Hussain-Elfalah/Agentic-Skillstheir own version, first seen Jun 4, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- JMBeresford/retrom★ 2.1k80% same
- netresearch/docker-development-skill★ 2459% same
Wrote their own version · 6
- Hassaan146/claude-skills★ 18same name
- csiddhant796-blip/claude-skills-collection★ 2same name
- Hussain-Elfalah/Agentic-Skills★ 2same name
- mahiunfiltered/claude-code-skills★ 1same name
- Arnav-0/claude-code-setup★ 0same name
- darkweb19/skills★ 0same name
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 repository3 other files it gives its agents.
- bash-masterSkill
- devopsSkill
- release-pr-notesSkill
The file
Files
Docker Development
Core Principles
- Minimal -- Alpine/distroless, multi-stage
- Secure -- Non-root USER, no layer secrets, pin versions
- Testable -- entrypoint bypass, DNS mocking
- Cache-efficient -- deps first, clean in-layer
Quick Reference
Multi-Stage Build (Node.js)
FROM node:24-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
FROM node:24-alpine
RUN addgroup -g 1001 app && adduser -u 1001 -G app -D app
USER app
COPY --from=builder /app .
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget -qO- http://localhost:3000/health || exit 1
CMD ["node", "server.js"]Multi-Stage Build (Go -- scratch/distroless)
FROM golang:1.26-alpine AS builder
WORKDIR /app
COPY go.* ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o /app/server .
FROM gcr.io/distroless/static:nonroot
COPY --from=builder /app/server /server
CMD ["/server"]Layer Optimization
RUN apt-get update && \
apt-get install -y --no-install-recommends curl && \
rm -rf /var/lib/apt/lists/*Build Cache: Copy Dependency Files First
COPY package*.json ./
RUN npm ci
COPY . .Manifests before source keeps install layers cached.
BuildKit Secrets
RUN --mount=type=secret,id=ssh_key,dst=/root/.ssh/id_rsa git clone git@github.com:org/repo.gitARG leaks via docker history and SLSA provenance --
references/build-secret-leaks.md
Docker Bake (Multi-Platform)
target "app" {
platforms = ["linux/amd64", "linux/arm64"]
cache-from = ["type=gha"]
cache-to = ["type=gha,mode=max"]
}Security Anti-Patterns
| Anti-pattern | Fix |
FROM image:latest | Pin version: image:1.2.3-alpine |
No USER directive | adduser + USER appuser |
chmod 777 | Use specific permissions: chmod 550 |
privileged: true in compose | Remove or use specific cap_add |
volumes: [/:/host] | Mount only needed paths |
ports: ["0.0.0.0:3000:3000"] | Bind to 127.0.0.1:3000:3000 |
ENV DB_PASSWORD=secret | Use --mount=type=secret or compose secrets |
CI Testing Gotchas
- Bypass entrypoint:
docker run --rm --entrypoint php myimage -v - Mock upstream DNS:
docker run --rm --add-host backend:127.0.0.1 nginx-image nginx -t - Compose validation:
cp .env.example .envbeforedocker compose config - Secret scanning: exclude
.env.example, README, docs - Root-owned artifacts: bind-mount dirs (
EACCES) --references/bind-mount-ownership.md
.dockerignore
Exclude: .git, node_modules/vendor, .env*, *.pem, *.key
Compose Essentials
- startup ordering:
depends_on.condition: service_healthy+healthcheckstart_period networks.internal: trueisolates databasesprofiles: [debug]: start only with--profile debug- shared image ref: define ONCE per file as top-level extension field + anchor --
x-app-image: &app-image registry/app:${APP_IMAGE_VERSION:-85}, services useimage: *app-image. The field must sit ABOVEservices:— an alias is only valid after its anchor in document order.:-defaults cover unset AND empty vars (a bare omitted tag silently resolves:latest). Anchors are file-local: every overlay file needs its own. Verify both paths:APP_IMAGE_VERSION= docker compose configand with an override
References
references/ci-testing.md-- CI testing patterns for Docker imagesreferences/dind-testing-patterns.md-- Docker-in-Docker testing patternsreferences/bind-mount-ownership.md-- root-owned bind-mount artifactsreferences/gpg-verification.md-- gpgv patterns; stale keybox locksreferences/registry-catalogue-and-pin-rot.md-- catalogue probes; pin rotreferences/build-secret-leaks.md--ARGin provenancereferences/php-fpm-worker-starvation.md-- keepalive pins php-fpm
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.

