Docker containers
Build, repair, and harden Docker-based development and deployment setups for applications and services. Use when any agent needs to create or update `Dockerfile`, `.dockerignore`, `compose.yaml` or `docker-compose.yml`, container entrypoints, multi-stage builds, local service orchestration, or container debugging workflows. Trigger for requests such as containerizing a Node/Python/Go app, adding Postgres or Redis with Compose, shrinking images, fixing container startup failures, debugging port or volume issues, improving Docker caching, or making a container setup safer for production.From its SKILL.md
npx -y skills add mdayan8/docker-containersAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
6.3 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
Docker Containers
Overview
Use this skill to move from "make this run in Docker" to a working, debuggable setup with sane defaults. Prefer small, reviewable changes and preserve the app's current run behavior unless the user asks to change it.
For concrete starter patterns, read examples.md.
Workflow Decision Tree
Choose the path that matches the request:
- No container files yet: create
Dockerfile,.dockerignore, and optionallycompose.yaml. - Existing Docker setup is broken: inspect the current files first, then fix the smallest root cause.
- Local multi-service dev is needed: add or repair
compose.yamlwith app, database, cache, and named volumes as needed. - Image is too large or slow: convert to multi-stage builds, tighten copy patterns, and improve cache layering.
- Production safety is requested: run as non-root when practical, set explicit ports and env handling, and avoid baking secrets into images.
Gather Context First
Read the app before editing container files:
- Detect the runtime and package manager from existing files such as
package.json,pyproject.toml,requirements.txt,go.mod,Gemfile, or framework config. - Find the real start command from scripts, docs, or the current process manager.
- Check whether the app needs build output before runtime, such as TypeScript, Next.js, Vite, or compiled binaries.
- Identify external dependencies such as PostgreSQL, Redis, queues, object storage, or headless browsers.
- Check for local-only assumptions that break in containers, especially hardcoded
localhost, file paths, and missing bind addresses.
If the stack-specific pattern is not obvious, read recipes.md.
Containerize an App
Follow this order:
- Pick a small, official base image that matches the runtime version already used by the project.
- Add a
.dockerignorebefore broadCOPYsteps to keep build context small. - Copy dependency manifests first, install dependencies, then copy the rest of the source to preserve cache hits.
- Use multi-stage builds when the runtime does not need compilers, package managers, or source files.
- Expose only the application port actually used by the service.
- Set the startup command to match the existing app behavior.
Prefer these defaults:
- Use one process per container unless the user explicitly wants a process supervisor.
- Bind servers to
0.0.0.0, not127.0.0.1. - Use exec-form
CMDandENTRYPOINT. - Keep build steps deterministic and avoid shell tricks unless required by the app.
Add Compose for Local Development
Use Compose when the app needs supporting services or a repeatable local workflow.
Include:
- one service for the app
- one service per dependency such as
db,redis, orworker - named volumes for persistent local state when data durability matters
- env file wiring only if the project already uses it or the user wants it
Compose rules:
- Use service names for container-to-container hostnames, not
localhost. - Map only the ports needed on the host machine.
- Add healthchecks when startup ordering matters.
- Prefer
depends_onplus healthchecks over sleep-based startup hacks. - Keep dev-oriented bind mounts out of production examples unless the user asks for dev containers specifically.
Debug Failing Containers
Work from symptoms to root cause:
- Read the container files and start command.
- Check whether the service listens on the expected port and address.
- Confirm required files are copied into the image.
- Check env vars, working directory, file permissions, and executable paths.
- Verify inter-service networking and DNS names under Compose.
- Verify readiness issues separately from simple startup failures.
Common fixes:
- Port works locally but not in Docker: bind to
0.0.0.0. - Build is slow: reorder layers so dependency install happens before source copy.
- Runtime cannot find files: fix
WORKDIR,COPY, or build output path. - App cannot reach database: use the Compose service name instead of
localhost. - Container exits immediately: fix the command, foreground process, or missing env vars.
If the failure pattern matches a known Docker issue, read troubleshooting.md.
Production-Safe Defaults
Apply these by default unless they conflict with the app:
- Use multi-stage builds for compiled or bundled applications.
- Keep images minimal and omit dev-only tooling from runtime layers.
- Avoid
latesttags in examples when a major version is known. - Avoid copying
.envfiles or secrets into the image. - Prefer a non-root user in the runtime stage when file permissions allow it.
- Keep writable paths explicit.
- Document required runtime env vars instead of hardcoding them.
Do not over-engineer:
- Do not add Kubernetes, reverse proxies, or process supervisors unless the task actually needs them.
- Do not invent healthchecks, workers, or sidecars without evidence in the app.
- Do not replace the application's package manager or framework conventions just to make the Dockerfile look cleaner.
Output Checklist
Before finishing, verify that:
- container files match the actual app runtime
- ports, env vars, and service hostnames are coherent
- build layers are cache-friendly
- the startup command matches the existing app behavior
- the setup distinguishes local dev concerns from production concerns
- the final result includes a short usage example such as
docker build,docker run, ordocker compose up
References
- Read examples.md for concrete starter Dockerfile and Compose patterns.
- Read recipes.md for starter patterns by stack.
- Read troubleshooting.md for common failure modes and fixes.
What ships with it: 9 files
14.5 KB alongside SKILL.md
agents/
- openai.yaml228 B
assets/
- banner.svg1.6 KB
- logo.svg824 B
references/
- examples.md1.9 KB
- recipes.md2.1 KB
- troubleshooting.md1.5 KB
- CONTRIBUTING.md534 B
- LICENSE1.0 KB
- README.md4.8 KB
Gives 3 of the 12 instructions most containers cloud skills give in ~1.2k tokens
Counted across 607 of the 657 authors here whose files we hold, read 2026-08-07
- Run containers as a non-root userhere, and in 66 of 607, across 46 files
- Use multi-stage buildshere, and in 53 of 607, across 44 files
- Use Promise.all for independent operationsin 47 of 607, across 13 files
- Import directly instead of barrel filesin 46 of 607, across 12 files
- Use ternary instead of AND for conditionalsin 45 of 607, across 12 files
- Use Set or Map for O(1) lookupsin 42 of 607, across 10 files
- Create a .dockerignore filein 41 of 607, across 31 files
- Read individual rule files for detailsin 39 of 607, across 9 files
- Copy dependency files before source codehere, and in 36 of 607, across 23 files
- Authenticate server actions like API routesin 35 of 607, across 7 files
- Use next/dynamic for heavy componentsin 34 of 607, across 9 files
- Use React.cache for per-request deduplicationin 34 of 607, across 10 files
Said here and by no other author read
- create docker and compose files
- inspect current files before fixing errors
- read the app configuration before editing files
- add dockerignore before copying broad directories
- verify startup command matches existing app behavior
- include a short usage example
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.