/docker-skills:docker-project-foundationsfrom docker-skills
Creates Dockerfile, compose.yaml, and .dockerignore for new or existing projects. Guides containerized local development with multi-stage builds, layer caching, and non-root users.
Ships in docker-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This skill guides you in Dockerizing a project from scratch. It focuses on creating the initial Docker file set, choosing a sane layout, and preferring containerized dependencies over host-level installs.
Activate this skill when:
Dockerfile, compose.yaml, or .dockerignore and does not have oneDo not use this skill when:
DockerfileWhen Dockerizing a project, always produce all three:
.dockerignore — Create this first so the initial build context is small and safe. See assets/dockerignore-example for a reference.Dockerfile — Create a working starter image definition that the project can build and run with. Start from assets/Dockerfile.simple and keep its baseline, even for a first scaffold:
node:22-slim), never latest;package.json + lockfile) copied before the source for layer caching;USER set in the final stage before CMD/ENTRYPOINT.compose.yaml — Create a local development stack that includes the application service and any required dependencies. See assets/compose-dev.yaml..npmrc at every depth with **/.npmrc in .dockerignore; otherwise a broad source copy can persist credentials in image layers.npmrc as a BuildKit secret for both npm ci steps. Public-package builds need no secret. For private registries, pass the config explicitly:
DOCKER_BUILDKIT=1 docker build --secret id=npmrc,src=<path-to-.npmrc> .
Use the actual config path if the project keeps it elsewhere. Never copy the credential file or pass its values through ARG or ENV. Dependency scripts run during installation can access the mounted secret; use trusted dependencies and a least-privilege registry token.compose.npm.yaml alongside the starter's compose.yaml:
services:
app:
build:
secrets:
- npmrc
secrets:
npmrc:
file: ${NPMRC_PATH:?Set NPMRC_PATH to your npm config file}
Build with NPMRC_PATH=<path-to-.npmrc> docker compose -f compose.yaml -f compose.npm.yaml build. This grants build-time access only, not a runtime secret. Public-package builds should omit the override so no credential file is required.When a project needs a database (Postgres, MySQL, MongoDB), cache (Redis, Memcached), queue (RabbitMQ, Kafka), or any other infrastructure service:
compose.yaml instead of telling the user to install it on the host.brew install postgres, apt install redis, or similar host-level installs for development dependencies.compose.yaml rather than legacy Compose filenames.docker/ subdirectory..env override.USER).Dockerfile that supports both via build stages and build arguments when possible.Dockerfile at the project root (or in a docker/ subdirectory if the project has multiple services).compose.yaml at the project root..dockerignore at the project root, next to the Dockerfile.docker-build-strategies. The starter baseline above (including a non-root USER) still applies here.docker-compose-patterns.docker system prune, docker rm -f, image/network/builder pruning) and a cross-product index of destructive-command guardrails, use docker-destructive-guardrails.references/project-structure.md — Detailed guidance on Docker project file organization, naming conventions, and multi-service layouts.assets/dockerignore-example — A comprehensive .dockerignore for a typical project.assets/compose-dev.yaml — A development-oriented Compose file with Dockerized dependencies.assets/Dockerfile.simple — A basic multi-stage Dockerfile following best practices.scripts/verify-setup.sh — Checks that required files exist in the current directory and validates its compose.yaml. Run it from the project root, with the script path resolved under this skill's directory:
bash "<skill-dir>/scripts/verify-setup.sh" [--help]
Replace <skill-dir> with the absolute path of the folder that contains this SKILL.md; the scripts/ path is relative to that folder, not to the project. Do not change into the skill directory first: the script checks the current directory. If the script is missing (some distributions, such as the Claude plugin, omit scripts/) or the skill directory cannot be resolved, check that .dockerignore, Dockerfile, and compose.yaml exist in the project root, then run docker compose config --quiet. Exit status is 0 when verification succeeds or help is requested, 1 when required files are missing or the Compose configuration is invalid, and 2 for invalid arguments.checks/verification.md — Detailed verification checklist for manual review.agents/openai.yaml (opens in a new tab)assets/Dockerfile.simple (opens in a new tab)assets/compose-dev.yaml (opens in a new tab)assets/dockerignore-example (opens in a new tab)checks/verification.md (opens in a new tab)evals/docker-project-foundations.md (opens in a new tab)references/project-structure.md (opens in a new tab)scripts/verify-setup.sh (opens in a new tab)skill.yaml (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub docker/skills --plugin docker-skills11 skills in this plugin
/docker-agent-configUse this skill when creating or editing an agent.yaml (or .yml/.hcl) configuration file for Docker Agent (cagent), including defining agents, models/providers, built-in or MCP toolsets, multi-agent teams with sub_agents. Even if the user just says they want to "build an AI agent with Docker", "make a coding agent config", "add a tool to my agent", or "set up a team of agents", this skill applies. Covers agent properties (model, instruction, toolsets, sub_agents, fallback), the models/providers sections, built-in toolsets (filesystem, shell, think, todo, memory, fetch), MCP toolset references, and named commands./docker-agent-deployUse this skill when exposing a Docker Agent as a server (MCP, HTTP API, A2A, ACP, or OpenAI-compatible chat), distributing an agent via an OCI registry with `docker agent share`, or measuring agent quality with `docker agent eval`. Even if the user just says they want to "turn my agent into an MCP server", "let Claude Desktop use my agent", "publish my agent to Docker Hub", "push my agent like an image", or "test my agent in CI", this skill applies. Covers `serve mcp/api/a2a/acp/chat` listen addresses and auth flags, `share push/pull`, eval session JSON format, scoring metrics, and the `--baseline` regression gate.Other plugins' skills for the same job