
Docker
Package apps into portable containers with Dockerfile, Compose, and production patterns so dev, test, and prod environments match.
Overview
docker is an agent skill most often used in Ship (also Build integrations, Operate infra) that packages applications into consistent container images and Compose stacks for dev through production.
Install
npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill dockerWhat is this skill?
- Progressive disclosure: entry summary, when_to_use, quick_start, then Dockerfile basics, multi-stage builds, and Docker
- Development workflows, production patterns, framework examples, orchestration, debugging, troubleshooting, and best_prac
- Targets consistency across development, testing, and production environments
- Universal toolchain skill tagged for containers, devops, infrastructure, and deployment
- Progressive disclosure with 11 named section groups including orchestration and troubleshooting
Adoption & trust: 723 installs on skills.sh; 53 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your app runs locally but breaks in CI or production because environments and dependencies drift.
Who is it for?
Solo builders shipping SaaS, APIs, or CLIs who want portable dev/prod parity without maintaining bespoke machine setup docs.
Skip if: Pure serverless-only deploys with no container runtime, or teams that only need Rust Drop lifecycle design without packaging.
When should I use this skill?
Use for Docker containerization when packaging applications for consistent dev, test, and production (local development, CI images, deploy prep).
What do I get? / Deliverables
You get repeatable Dockerfiles, multi-stage builds, and Compose workflows your agent can apply for dev, test, and launch-ready deploy artifacts.
- Dockerfile
- docker-compose.yml or stack definition
- Documented dev/prod run commands
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Ship because containerization is the bridge from built code to repeatable, safe launch artifacts—eliminating works-on-my-machine before production. Launch subphase under Ship covers image builds, compose stacks, and deploy-ready container workflows referenced in the skill’s production and orchestration sections.
Where it fits
Spin up a Compose stack so your API and database match what CI will run.
Produce a slim multi-stage image ready to push before your first production deploy.
Use the debugging and troubleshooting sections when a container exits or fails health checks in prod.
How it compares
Skill package for Dockerfile and Compose workflows—not an MCP server and not a cloud-specific IaC module.
Common Questions / FAQ
Who is docker for?
Indie builders and small teams using Claude Code or similar agents to standardize local dev, CI images, and production container patterns.
When should I use docker?
During Build for local integration testing in containers, during Ship when preparing launch images and Compose stacks, and during Operate when debugging running containerized services.
Is docker safe to install?
Check the Security Audits panel on this Prism page; SKILL.md describes container workflows and may imply shell and filesystem access when agents build images—review before auto-running commands.
SKILL.md
READMESKILL.md - Docker
{ "name": "docker", "version": "1.0.0", "category": "universal", "toolchain": "universal", "tags": [ "docker", "containers", "devops", "infrastructure", "deployment" ], "entry_point_tokens": 78, "full_tokens": 7794, "related_skills": [], "author": "claude-mpm-skills", "license": "MIT", "created": "2025-11-30", "updated": "2025-12-31", "source_path": "toolchains/universal/infrastructure/docker/SKILL.md", "repository": "https://github.com/bobmatnyc/claude-mpm-skills", "subcategory": "infrastructure" } --- name: docker description: Docker containerization for packaging applications with dependencies into isolated, portable units ensuring consistency across development, testing, and production environments. user-invocable: false disable-model-invocation: true progressive_disclosure: entry_point: - summary - when_to_use - quick_start sections: - core_concepts - dockerfile_basics - multi_stage_builds - docker_compose - development_workflows - production_patterns - framework_examples - orchestration - debugging - troubleshooting - best_practices --- # Docker Containerization Skill ## Summary Docker provides containerization for packaging applications with their dependencies into isolated, portable units. Containers ensure consistency across development, testing, and production environments, eliminating "works on my machine" problems. ## When to Use - **Local Development**: Consistent dev environments across team members - **CI/CD Pipelines**: Reproducible build and test environments - **Microservices**: Isolated services with independent scaling - **Production Deployment**: Portable applications across cloud providers - **Database/Service Testing**: Ephemeral databases for integration tests - **Legacy Application Isolation**: Run incompatible dependencies side-by-side ## Quick Start ### 1. Create Dockerfile ```dockerfile FROM node:18-alpine WORKDIR /app COPY package*.json ./ RUN npm ci --only=production COPY . . EXPOSE 3000 CMD ["node", "server.js"] ``` ### 2. Build Image ```bash docker build -t myapp:1.0 . ``` ### 3. Run Container ```bash docker run -p 3000:3000 myapp:1.0 ``` --- ## Core Concepts ### Images vs Containers - **Image**: Read-only template with application code, runtime, and dependencies - **Container**: Running instance of an image with writable layer - **Registry**: Storage for images (Docker Hub, GitHub Container Registry) ### Layers and Caching Each Dockerfile instruction creates a layer. Docker caches unchanged layers for faster builds. ```dockerfile # GOOD: Dependencies change less frequently than code FROM python:3.11-slim COPY requirements.txt . RUN pip install -r requirements.txt # Cached unless requirements.txt changes COPY . . # Rebuild only when code changes # BAD: Invalidates cache on every code change FROM python:3.11-slim COPY . . # Changes frequently RUN pip install -r requirements.txt # Reinstalls on every build ``` ### Volumes Persistent data storage that survives container restarts. ```bash # Named volume (managed by Docker) docker run -v mydata:/app/data myapp # Bind mount (host directory) docker run -v $(pwd)/data:/app/data myapp # Anonymous volume (temporary) docker run -v /app/data myapp ``` ### Networks Containers communicate through Docker networks. ```bash # Create network docker network create mynetwork # Run containers on network docker run --network mynetwork --name db postgres docker run --network mynetwork --name app myapp # App can connect to db using hostname "db" ``` --- ## Dockerfile Basics ### Essential Instructions ```dockerfile # Base image FROM node:18-alpine # Metadata LABEL maintainer="dev@example.com" LABEL version="1.0" # Set working directory WORKDIR /app # Copy files COPY package*.json ./ COPY src/ ./src/ # Run commands (creates layer) RUN npm ci --only=production # Set enviro