
docker
Build, run, debug, and manage Docker containers, images, compose files, networking, volumes, registries, Buildx/Bake, Scout/SBOM, Swarm, and Docker AI tooling. Use when the user mentions docker, containers, containerizing, Dockerfile, compose, image registry, volumes, or any docker subcommand.
- Installs
- 41
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/greedychipmunk/agent-skills --skill docker- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads docker automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Docker
Use this skill to keep Docker work deterministic, safe, and fast across Linux, macOS, and Windows Docker Desktop hosts.
Quick Start
- Run
scripts/probe-docker.ps1(Windows) ordocker info/docker version(Linux/macOS) first for environment truth. - Choose the smallest workflow that solves the request:
- Core container/build/compose workflow in this file covers ~80% of tasks.
- Load a reference file only when you need depth on a specific domain.
- Reuse
assets/templates/starter packs before writing boilerplate from scratch.
- Default to read-only diagnostics before proposing mutating commands.
- Confirm before destructive commands (
rm,prune,down -v,sandbox reset, builder/cache deletion). - Prefer installed CLI behavior when docs and runtime diverge; note the caveat with concrete versions.
Intent Router (Progressive Disclosure)
Load only the reference file needed for the active request.
resources/install-and-setup.md— Installing Docker Desktop (macOS/Windows) or Docker Engine (Linux), and post-install configuration.resources/core.md— Windows Desktop-first diagnostics, context management, Desktop status.resources/containers.md—run/exec/logs/inspect/debug/statsand crash triage.resources/images.md— Dockerfile authoring, multi-stage patterns, Buildx/Bake.resources/compose.md— Compose authoring and service orchestration.resources/networking.md— bridge/overlay/macvlan, DNS, port publishing.resources/volumes.md— named volumes, bind mounts, backup/restore patterns.resources/registry.md— login/tag/push/pull and registry hygiene.resources/swarm.md— swarm init, services, stacks, safe operations.resources/troubleshooting.md— systematic debugging and error classification.resources/security.md— Scout, SBOM, DHI, pass secrets, supply chain checks.resources/ai-and-agents.md— Docker AI, agent/cagent, MCP toolkit, model runner, sandbox.resources/cloud-and-remote.md— Offload, Build Cloud, remote builders and contexts.
Quick Command Reference
These cover ~80% of daily Docker use. Use them directly without loading a reference file.
# Container lifecycle
docker run -d --name myapp -p 8080:80 nginx # Run detached with port mapping
docker run -it --rm ubuntu bash # Interactive, auto-remove on exit
docker ps # List running containers
docker ps -a # All containers (incl. stopped)
docker stop myapp && docker rm myapp # Stop and remove
docker logs myapp -f # Follow logs
docker logs myapp --tail=100 # Last 100 lines
docker exec -it myapp bash # Shell into running container
docker inspect myapp # Full metadata (JSON)
docker stats # Live resource usage
# Images
docker build -t myapp:latest . # Build from Dockerfile in cwd
docker pull nginx:alpine # Pull image
docker images # List local images
docker rmi myapp:latest # Remove image
docker tag myapp:latest myregistry/myapp:v1.2 # Tag for push
# Compose (v2 — no hyphen)
docker compose config # Validate and view merged config
docker compose up -d # Start all services detached
docker compose down # Stop and remove containers+networks
docker compose logs -f api # Follow logs for one service
docker compose exec api sh # Shell into service container
docker compose ps # Service status
docker compose build --no-cache # Rebuild all images
# Buildx / multi-platform
docker buildx ls
docker buildx build --platform linux/amd64,linux/arm64 -t myorg/myapp:v1 --push .
# System
docker system df # Disk usage breakdown
docker system prune # Remove unused objects (see safety)
Safety Matrix
| Command or Pattern | Required Guardrail |
|---|---|
docker system prune / prune -a | Run docker system df first; summarize what will be removed, then confirm. |
docker volume rm | Warn that volume data is permanently deleted and require explicit confirmation. |
docker network rm | Check for attached containers first and list impacted services before remove. |
docker rm -f | Confirm exact container names; avoid bulk force-remove without listing targets. |
docker rmi -f | Check container/image dependents first and confirm impact. |
docker swarm leave --force | Explain manager impact and require explicit confirmation. |
docker compose down -v | Call out database/state loss risk and require explicit confirmation. |
docker sandbox reset | Treat as destructive reset; require explicit confirmation. |
docker push to registry | Confirm the full destination tag before pushing. |
--privileged flag | Explain what it grants and why it's risky before using. |
Writing Dockerfiles
When asked to write a Dockerfile, always apply these best practices by default:
- Layer order — put things that change least at the top (base image, system deps), most at the bottom (app code). Maximizes cache reuse.
- Multi-stage builds — compile/install in a build stage; copy only artifacts to a minimal runtime image.
- Non-root user — create and switch to a non-root user before CMD.
- Minimal base image — prefer
alpine,distroless, orslim. Use full images only when system packages are needed. - Combine RUN commands — chain related commands with
&&; clean up package caches in the same layer. - Always create
.dockerignorealongside Dockerfile.
For complete Dockerfile templates (Node.js, Python, Go) and .dockerignore patterns, see resources/images.md.
Docker Compose Authoring
Key patterns for compose files:
- Use
condition: service_healthyondepends_onwhen the dependency has a healthcheck. - Always define named volumes rather than bare bind mounts for data you care about.
- Scope services to internal-only networks when they don't need external access.
- Use
restart: unless-stoppedfor production; omit for dev tooling containers. - Set an explicit
name:at the top to avoid directory-name collisions.
For complete compose file templates with health checks, see resources/compose.md.
Diagnostic Workflow
When a container is crashing or misbehaving:
docker ps -a # Find container and exit code
docker logs <name> --tail=100 # Last 100 lines (stderr included with 2>&1)
docker inspect <name> # Full JSON — check State, Config, Mounts
docker stats --no-stream # Snapshot of memory/CPU (check for OOM)
docker exec -it <name> sh # Shell in (if still running)
docker debug <name> # Debug sidecar, works on stopped containers
docker compose ps && docker compose logs --tail=50 # Compose: all services at once
Exit codes: 0 = clean exit, 1 = app error, 137 = OOM killed, 139 = segfault, 143 = SIGTERM, 125/126/127 = Docker/exec errors.
Core Workflow (Windows Desktop)
- Establish baseline — Run
scripts/probe-docker.ps1 -Jsonfor structured diagnostics (CLI version, context, plugin availability, daemon reachability). - Diagnose before changing state — Run
scripts/doctor-docker.ps1for actionable checks. Use-Quickfor fast triage;-IncludeScout/-IncludeOffloadonly when in scope. - Execute scoped operations — container lifecycle, build pipeline, compose orchestration, context/Desktop checks.
- Report findings by root cause — sandbox/host permission boundary, daemon/service state, config mismatch.
Resource Index
scripts/probe-docker.ps1—probe-docker.ps1 [-Json] [-IncludeExperimental]— read-only host/runtime probe.scripts/doctor-docker.ps1—doctor-docker.ps1 [-Quick] [-IncludeOffload] [-IncludeScout]— diagnostics and recommendations.assets/templates/— reusable starter packs for minimal service, compose stack, and multi-arch Buildx.resources/*.md— deep domain coverage (see Intent Router above).
FAQ
What does the docker skill do?
Build, run, debug, and manage Docker containers, images, compose files, networking, volumes, registries, Buildx/Bake, Scout/SBOM, Swarm, and Docker AI tooling. Use when the user mentions docker, containers, containerizing, Dockerfile, compose, image registry, volumes, or any docker subcommand.
How do I install docker?
Run npx skills add https://github.com/greedychipmunk/agent-skills --skill docker in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/docker/ (personal) or .claude/skills/docker/ (project).
Which AI agents can use docker?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is docker safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains docker?
It is published by greedychipmunk in greedychipmunk/agent-skills. It has 41 recorded installs.
More from greedychipmunk/agent-skills
roblox-game-development
greedychipmunk/agent-skills
Use this skill for any Roblox related tasks
medusajs-developer
greedychipmunk/agent-skills
Open the skill to read its SKILL.md instructions.
angularjs-unit-testing
greedychipmunk/agent-skills
Use this skill for AngularJS unit testing, maintenance, and migration tasks
nextjs-developer
greedychipmunk/agent-skills
Expert Next.js development with App Router, Server Components, and modern React patterns
supabase-developer
greedychipmunk/agent-skills
Expert Supabase development with PostgreSQL, authentication, Row Level Security, Storage, Edge Functions, and Realtime subscriptions
Popular devops & cloud skills
microsoft-foundry
microsoft/azure-skills
Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, managed harness agent create, GitHub Copilot harness agent, create agent, update agent, add tool to agent, invoke agent, agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, optimize agent instructions, Agent Optimizer scaffold, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure
azure-diagnostics
microsoft/azure-skills
Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.
azure-prepare
microsoft/azure-skills
Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an azure.yaml file. DO NOT USE FOR: non-azd deployments, Python App Service code-only deploys (use python-appservice-deploy), or cross-cloud migration (use azure-cloud-migrate). WHEN: prepare app for azd, create azure.yaml, set up azd infrastructure, modernize app for Azure with azd, deploy with azd, function app, timer trigger, service bus trigger, event-driven function, managed identity, generate Bicep, generate Terraform, create and deploy to Azure.
azure-ai
microsoft/azure-skills
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
azure-deploy
microsoft/azure-skills
Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: "run azd up", "run azd deploy", "execute deployment", "push to production", "push to cloud", "go live", "ship it", "bicep deploy", "terraform apply", "publish to Azure", "launch on Azure". DO NOT USE WHEN: "create and deploy", "build and deploy", "create a new app", "set up infrastructure", "create and deploy to Azure using Terraform" — use azure-prepare for these.
azure-validate
microsoft/azure-skills
Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.