docker-development
What it does
This skill guides the agent in writing, optimizing and reviewing Docker container setups. It is for developers who want containers that are quick to build, small in size and safe to run.
When to use it
- βWhen your Docker build is slow or your image is too large.
- βWhen you want to set up a docker-compose file for a project.
- βWhen you want to check a Dockerfile for security problems before shipping it.
Skill link
https://github.com/alirezarezvani/claude-skills/blob/main/engineering/docker-development/skills/docker-development/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βMy Docker image is too large and the build is slow. Optimize the Dockerfile for size and caching.β
5 new skills a week. 1 minute to read.
How it works
The agent analyzes the Dockerfile's layers, caching and size, then suggests changes such as multi-stage builds. It also validates compose files and audits security issues in a Dockerfile or a running container.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Docker Development
Smaller images. Faster builds. Secure containers. No guesswork.
Opinionated Docker workflow that turns bloated Dockerfiles into production-grade containers. Covers optimization, multi-stage builds, compose orchestration, and security hardening.
Not a Docker tutorial β a set of concrete decisions about how to build containers that don't waste time, space, or attack surface.
Slash Commands
| Command | What it does |
|---|---|
/docker-development optimize |
Analyze and optimize a Dockerfile for size, speed, and layer caching |
/docker-development compose |
Generate or improve docker-compose.yml with best practices |
/docker-development security |
Audit a Dockerfile or running container for security issues |
When This Skill Activates
Recognize these patterns from the user:
- "Optimize this Dockerfile"
- "My Docker build is slow"
- "Create a docker-compose for this project"
- "Is this Dockerfile secure?"
- "Reduce my Docker image size"
- "Set up multi-stage builds"
- "Docker best practices for [language/framework]"
- Any request involving: Dockerfile, docker-compose, container, image size, build cache, Docker security
If the user has a Dockerfile or wants to containerize something β this skill applies.
Workflow
/docker-development optimize β Dockerfile Optimization
Analyze current state
- Read the Dockerfile
- Identify base image and its size
- Count layers (each RUN/COPY/ADD = 1 layer)
- Check for common anti-patterns
Apply optimization checklist
BASE IMAGE βββ Use specific tags, never :latest in production βββ Prefer slim/alpine variants (debian-slim > ubuntu > debian) βββ Pin digest for reproducibility in CI: image@sha256:... βββ Match base to runtime needs (don't use python:3.12 for a compiled binary) LAYER OPTIMIZATION βββ Combine related RUN commands with && \ βββ Order layers: least-changing first (deps before source code) βββ Clean package manager cache in the same RUN layer βββ Use .dockerignore to exclude unnecessary files βββ Separate build deps from runtime deps BUILD CACHE βββ COPY dependency files before source code (package.json, requirements.txt, go.mod) βββ Install deps in a separate layer from code copy βββ Use BuildKit cache mounts: --mount=type=cache,target=/root/.cache βββ Avoid COPY . . before dependency installation MULTI-STAGE BUILDS βββ Stage 1: build (full SDK, build tools, dev deps) βββ Stage 2: runtime (minimal base, only production artifacts) βββ COPY --from=builder only what's needed βββ Final image should have NO build tools, NO source code, NO dev depsGenerate optimized Dockerfile
- Apply all relevant optimizations
- Add inline comments explaining each decision
- Report estimated size reduction
Validate
python3 scripts/dockerfile_analyzer.py Dockerfile
/docker-development compose β Docker Compose Configuration
Identify services
- Application (web, API, worker)
- Database (postgres, mysql, redis, mongo)
- Cache (redis, memcached)
- Queue (rabbitmq, kafka)
- Reverse proxy (nginx, traefik, caddy)
Apply compose best practices
SERVICES βββ Use depends_on with condition: service_healthy βββ Add healthchecks for every service βββ Set resource limits (mem_limit, cpus) βββ Use named volumes for persistent data βββ Pin image versions NETWORKING βββ Create explicit networks (don't rely on default) βββ Separate frontend and backend networks βββ Only expose ports that need external access βββ Use internal: true for backend-only networks ENVIRONMENT βββ Use env_file for secrets, not inline environment βββ Never commit .env files (add to .gitignore) βββ Use variable substitution: ${VAR:-default} βββ Document all required env vars DEVELOPMENT vs PRODUCTION βββ Use compose profiles or override files βββ Dev: bind mounts for hot reload, debug ports exposed βββ Prod: named volumes, no debug ports, restart: unless-stopped βββ docker-compose.override.yml for dev-only configGenerate compose file
- Output docker-compose.yml with healthchecks, networks, volumes
- Generate .env.example with all required variables documented
- Add dev/prod profile annotations
/docker-development security β Container Security Audit
- **Dockerfile
FAQ
What is a multi-stage build?
It is a Dockerfile that uses one stage to build the app and a smaller stage to run it, so the final image is leaner.
Can it check a running container?
Yes. The security command can audit a Dockerfile or a running container.
Does it help with docker-compose?
Yes. It can generate or improve a docker-compose file using best practices.
Details
Original description by the author
Use for any Dockerfile or docker-compose file to write, optimize or review, before editing it. Checks layers, caching, size and security with dockerfile_analyzer.py and validates compose files with compose_validator.py.
Popularity
- GitHub stars
- 29k
- Ranking position
- #9555
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
agent-launcher-orchestrator
29kHelps your agent plan, build, test and schedule a Claude managed agent in your own account, step by step, starting from one clear goal.
grade-iterate
29kLets your agent grade a managed AI agent's work against a rubric and improve it in a fixed number of rounds, so it never loops forever.
interview
29kLets your agent interview you about an AI agent idea and turn your answers into a simple build plan before anything is launched.
run-without-you
29kHelps your agent set up a managed AI agent to run on a schedule or when an event happens, with the cron timing checked before launch.
Similar skills
openclaw-update
394kHelps your agent update an existing OpenClaw Gateway, choosing the update method that fits how it was installed and keeping your session working.
diagnose-gateway
394kHelps your agent find out why your OpenClaw Gateway is failing by checking settings, channels, and ports without changing anything.
crabbox-apps
394kHelps your agent open and run an app on a temporary cloud machine, then show its view in your chat side panel.