
docker-development
Docker image development skill that guides Dockerfiles, Compose, and Bake builds with CI testing patterns.
- GitHub stars
- 92
What it does
- Adds
docker-developmentskill for Dockerfile, docker-compose, docker-bake.hcl, and .dockerignore work, plus adocker-via-wslskill for Windows shells - Covers multi-stage builds, layer optimization, Docker Bake multi-platform builds, Trivy scanning, and network isolation
- Documents CI testing patterns such as entrypoint bypass, nginx DNS mocking, and compose validation with a generated .env file
- Designed for developers and AI agents writing container images, Compose stacks, or CI pipelines that build and test them
Docker image development patterns for Dockerfile, docker-compose, docker-bake.hcl, and .dockerignore. Multi-stage builds, layer optimization, CI testing patterns (entrypoint bypass, DNS mocking, compose validation), Docker Bake multi-platform, Trivy scanning, network isolation. By Netresearch.
Add marketplace
/plugin marketplace add netresearch/claude-code-marketplaceRun it inside Claude Code once, then install the plugin below.
Install
/plugin install docker-development@netresearch-claude-code-marketplaceRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourceDocker 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.git
ARG leaks via docker history and SLSA provenance --
references/build-secret-leaks.md
Docker Bake (Multi-Platform)
target "app" {
platforms = ["linux/amd64", "linux/arm64"]
}
CI builds go through Bake and netresearch/.github/.github/workflows/build-container-bake.yml@main, one image or several. The reusable adds a GHA cache per target, so the HCL declares none; a scheduled rebuild passes cache: false -- references/bake-ci-cache.md
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. The probe runs with the image's own tools: bare Alpine has busyboxwgetand nocurl(check the image), andlocalhostresolves to::1first -- probe the address the server listens on,127.0.0.1for IPv4 (references/compose-runtime-lifecycle.md);mariadb:11+has nomysqladmin-- usehealthcheck.sh(references/database-container-readiness.md) - swapping a service's image keeps its anonymous volume at a path the new image's
VOLUMEor the compose file declares (redis:8.0→valkey/valkey:9withvolumes: [/data]hands Valkey an RDB it cannot load) -- for disposable data rename the service (and updatedepends_onand clients) or runup -V --no-deps <service>; a bare-Valso renews a database's anonymous volume (references/compose-runtime-lifecycle.md) networks.internal: trueisolates databasesprofiles: [debug]: start only with--profile debug.downand--remove-orphansignore a disabled profile's containers, so a service you stop enabling keeps running --docker compose --profile '*' down, ordocker compose down <service>(references/compose-runtime-lifecycle.md)- logging drivers block by default: a stalled remote endpoint (
awslogs, ...) stalls the app's writes;mode: non-blocking+max-buffer-sizedrops lines instead, protecting a running container only (references/compose-runtime-lifecycle.md) - a socket-reading scheduler (Ofelia) runs the job labels of every stack on the host:
--docker-filter label=com.docker.compose.project=${COMPOSE_PROJECT_NAME}, written in the compose file itself (references/compose-runtime-lifecycle.md) COMPOSE_FILE(shell or.env) loads exactly that list, socompose.override.ymlis silently not merged -- list it in the pin; anddocker compose configprints a literal$as$$, so measure values withprintenvinside a container (references/compose-config-and-env.md)- 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/bake-ci-cache.md-- the shared bake reusable;-f docker-bake.hclbeside a compose file; GHA cache scope per target; uncached scheduled rebuild that still writes the cache; helper steps in bake-action's directoryreferences/ci-testing.md-- CI testing patterns for Docker images; busyboxshvs bash in-cstrings;timeoutarounddocker compose runleaves the container running when PID 1 ignores the signal; a negative control taken from a mutable base tag expires when upstream ships the fix; a local fallback build that matches CI (git archive <tag> | docker build -)references/dind-testing-patterns.md-- Docker-in-Docker testing patternsreferences/bind-mount-ownership.md-- root-owned bind-mount artifacts; a tmpfs on a parent path hiding a volume below itreferences/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; withfastcgi.loggingon a long PHP error overflowsfastcgi_buffer_size, and on a service with several addressesmax_failsturns those 502s intono live upstreamsfor everyonereferences/engine-and-image-upgrades.md--MinAPIVersioncuts off socket-reading sidecars; probe-container upgrade check; a base image changing itsUSER; PHP 8.5 OPcache built into the core; run the tests of images builtFROMa base before changing what it shipsreferences/pinned-source-fetch.md-- a commit hash fetched from GitHub may come from any fork; fetch the upstream branch and require the pin to be its ancestorreferences/database-container-readiness.md-- seeded DB images logready for connectionstwice; verify the seed, not the log;mariadb:11+drops themysql*binaries; major upgrade of an existing data directory (MARIADB_AUTO_UPGRADE,healthcheck.sh, manualdocker stop -t,stop_grace_period)references/compose-runtime-lifecycle.md-- a disabled profile's container survivesdownandup --remove-orphans; blocking vs non-blocking log delivery and what non-blocking does not protect; an Ofelia on the Docker socket runs other stacks' jobs unless filtered to its own project; an image swap keeps an anonymous volume the new container declares; healthcheck probes inside Alpine imagesreferences/compose-config-and-env.md-- aCOMPOSE_FILEpin disables thecompose.override.ymlmerge;docker compose configre-escapes$as$$, so it is not what the container receivesreferences/image-ca-trust.md-- after a CA compromise: measure the published image'sca-certificatesversion and root subjects;grepfor a CA name in the bundle always returns 0
Readme
Docker Development Skill
Agent Skill for Docker image development - Dockerfile best practices, CI testing patterns, and Docker Compose orchestration.
Features
- Dockerfile Best Practices - Multi-stage builds, layer optimization, security
- CI Testing Patterns - Test Docker images reliably in CI pipelines
- Docker Compose - Service orchestration, health checks, networking
- Docker Bake - Multi-platform builds with BuildKit
- Security - Vulnerability scanning, non-root users, secret management
- Windows / WSL2 - Run docker through WSL when Docker Desktop uses the WSL2 backend (separate
docker-via-wslskill)
Skills
This package bundles two skills:
docker-development— Dockerfile, compose, bake, CI testing, and security patterns.docker-via-wsl— for AI agents running on a Windows host outside WSL: re-issue everydocker/docker composecommand inside WSL (viawsl.exe) so Docker Desktop's WSL2 backend does not corrupt bind-mount paths.
Automatic Triggers
The docker-development skill activates automatically when working with:
| File Pattern | Description |
|---|---|
Dockerfile, Dockerfile.*, *.dockerfile | Container image definitions |
docker-compose.yml, compose.yml | Multi-container orchestration |
docker-bake.hcl | BuildKit bake configurations |
.dockerignore | Build context optimization |
The docker-via-wsl skill activates when an agent on a Windows shell (Git Bash/MSYS/PowerShell, outside WSL) is about to run any docker command.
Installation
Marketplace (Recommended)
Add the Netresearch marketplace once, then browse and install skills:
# Claude Code
/plugin marketplace add netresearch/claude-code-marketplace
/plugin install docker-development@netresearch-claude-code-marketplace
Without a marketplace
Since Claude Code 2.1.157 a plugin directory under your personal skills directory loads on its own:
mkdir -p ~/.claude/skills
git clone https://github.com/netresearch/docker-development-skill.git \
~/.claude/skills/docker-development
It loads as docker-development@skills-dir on the next session. Update with git -C ~/.claude/skills/docker-development pull and start a new session; remove it by deleting the directory. This route has no claude plugin update.
npx (skills.sh)
Install with any Agent Skills-compatible agent:
npx skills add https://github.com/netresearch/docker-development-skill --skill docker-development
npx skills add https://github.com/netresearch/docker-development-skill --skill docker-via-wsl
Download Release
Download the latest release and extract to your agent's skills directory.
Git Clone
git clone https://github.com/netresearch/docker-development-skill.git
Composer (PHP Projects)
composer require netresearch/docker-development-skill
Requires netresearch/composer-agent-skill-plugin.
Usage
The skill activates automatically when working on:
- Dockerfile development
- Docker Compose configurations
- Docker Bake multi-platform builds
- CI/CD pipelines for container images
- Container troubleshooting
Example Prompts
- "Create a multi-stage Dockerfile for a Node.js app"
- "Set up GitHub Actions to build and push Docker images"
- "Why is my nginx config test failing in CI?"
- "Add health checks to my docker-compose.yml"
- "Create a docker-bake.hcl for multi-platform builds"
Key Patterns
Testing Images with Entrypoints
# Bypass entrypoint for direct testing
docker run --rm --entrypoint php myimage -v
Testing nginx Configs in Isolation
# Mock upstream DNS
docker run --rm --add-host backend:127.0.0.1 nginx-image nginx -t
Compose Validation in CI
# Create .env before validation
cp .env.example .env
sed -i 's/PLACEHOLDER/test_value/g' .env
docker compose config > /dev/null
References
Extended documentation in the skill references/ directories:
docker-development/references/ci-testing.md- Retro-born CI testing gotchasdocker-via-wsl/references/diagnosis-and-fix.md- Diagnose and fix a wrong bind mount caused by driving Docker from a Windows shell
Contributing
- Fork the repository
- Create a feature branch
- Submit a pull request
Tests
The behavioural tests live in tests/ and need bash, git and python3; tests/check-allowed-tools.sh also needs yq (v4):
bash tests/check-plugin-version.sh # Build/Scripts/check-plugin-version.sh and Build/hooks/pre-push
bash tests/check-allowed-tools.sh # allowed-tools in every skills/*/SKILL.md
tests/check-plugin-version.sh builds throwaway git repositories and checks that a semver tag at HEAD (with or without a v prefix) must match the version in .claude-plugin/plugin.json, that non-semver tags and untagged commits pass, that an empty version or a missing plugin.json fails, and that the pre-push hook passes the result on.
tests/check-allowed-tools.sh reads the allowed-tools list of every skills/*/SKILL.md and fails when an entry is not one of the read-only tools it names (Read, Glob, Grep, grep, uname and the read-only docker subcommands version, info, ps, images, inspect, history, logs). It reads the front matter with yq, so a YAML list and a string of tools are read in every YAML form; it needs bash, yq (v4) and python3.
Each check prints ok or FAIL; a FAIL line is followed by the expected and actual exit code and the script's output. The test exits 1 when any check failed. In CI, the Skill Tests workflow (.github/workflows/tests.yml) runs every tests/**/*.sh on each pull request and on pushes to main.
The skills themselves are instructions in Markdown and ship no executable scripts; Skill Validation and Eval Validation check their structure and the eval definitions in evals/evals.json. A pull request that adds or changes behaviour in a script adds or updates a check in tests/ that fails without the change.
Governance and policies
This repository follows the Netresearch organisation policies:
- Governance: ownership, roles, how decisions are made and disputes resolved, and continuity.
- Roadmap: planned and explicitly excluded work for the coming year.
- Handling of dependency and code analysis findings: thresholds, deadlines and the exception process for dependency (SCA) and static analysis (SAST) findings.
- Secret management: how CI and release credentials are stored, accessed and rotated.
- Access roster: who holds administrative access to this repository and the organisation.
The security assurance case for this skill (threat model, trust boundaries, countermeasures and limits) is in docs/SECURITY-ASSURANCE.md.
Checks that run on pull requests in this repository:
- Every pull request: Skill Validation (
lint.yml: skill structure, markdownlint, yamllint, actionlint, JSON syntax, ShellCheck, ruff, checkpoint schema), Eval Validation (eval-validate.yml) and Skill Tests (tests.yml). - Pull requests to
main:security.ymlwith Betterleaks (secret scanning), zizmor (workflow static analysis), dependency review, Composer Audit and Opengrep SAST (both behind a preflight event-gate job), and CodeQL foractions; Harness Verification (harness-verify.yml) and Template Drift (check-template-drift.yml). The organisation's security policy sets when dependency review and Opengrep fail: see dependencies and static analysis (SAST). - Also on every pull request: Labeler (
labeler.yml), the DCO sign-off check, SonarCloud Code Analysis and the CodeRabbit review status (GitHub Apps) and, for dependency-update pull requests, auto-merge (auto-merge-deps.yml).
License
This project uses split licensing:
- Code (scripts, workflows, configs): MIT
- Content (skill definitions, documentation, references): CC-BY-SA-4.0
See the individual license files for full terms.
Author
Details
- Marketplace
- netresearch/claude-code-marketplace
- Source
- netresearch/docker-development-skill
- Category
- Devops
- Listed since
- Apr 7, 2026
More from netresearch/claude-code-marketplace
All 41- enterprise-readiness
- file-search
- formal-model-checking
- german-technical-writing
- git-workflow
- github-project
- github-release
- go-development
- jira-integration
- jujutsu-workflow
- markdown-to-pdf
- matrix-communication
- netresearch-branding
- orocommerce
- peer-qa-review
- php-modernization
- php-structured-edit
- retro
- security-audit
- skill-repo
- typo3-a11y
- typo3-ckeditor5
- typo3-conformance
- typo3-core-contributions
Similar to docker-development
More DevOps & Cloud
docker-wizardPluginglincker/claude-code-marketplace38 starsGenerate optimized Dockerfiles and docker-compose.yml with best practices
docker-expertSkilldavila7/claude-code-templates900 installsComprehensive Docker containerization guidance covering multi-stage builds, image size reduction, container hardening, and Compose orchestration.
dockerSkillbobmatnyc/claude-mpm-skills1.1K installsContainerization skill that packages applications and dependencies into portable images for consistent development, testing, and production.
docker-helperPluginrohitg00/awesome-claude-code-toolkit2.8K starsBuild optimized Docker images and improve Dockerfile best practices
docker-toolkitPluginarmanzeroeight/fastagent-plugins29 starsDocker containerization toolkit for image optimization, security scanning, and container best practices. Includes container architect agent for strategic contai
docker-composePluginTheBushidoCollective/han201 starsDocker Compose validation and best practices for container orchestration