Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Docker

ASecurity

ALWAYS activate when the user's query involves Docker in any way — even if it also matches other skills. If the words docker, Dockerfile, docker-compose, compose.yml, container, or image appear in the query, this skill MUST be used. Covers: writing or editing Dockerfiles and compose files, adding services (postgres, redis, etc.) to compose, volume mounts and data persistence, docker build failures (layer caching, npm install issues), healthchecks and service startup ordering (depends_on), env...

119 stars
0 votes
0 copies
2 views
Added 5/28/2026
ai-agentspythongoshellnodedockerdebugginggitdatabasesecuritydocumentation

Security Analysis

A92/100
mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 5 files and shows the line behind each finding

Scanned 5/28/2026

$npx -y skills add avibebuilder/claude-prime --skill docker --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Docker?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Docker
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/avibebuilder-docker/badge)](https://www.skillsdirectory.com/skills/avibebuilder-docker)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: docker
description: "ALWAYS activate when the user's query involves Docker in any way — even if it also matches other skills. If the words docker, Dockerfile, docker-compose, compose.yml, container, or image appear in the query, this skill MUST be used. Covers: writing or editing Dockerfiles and compose files, adding services (postgres, redis, etc.) to compose, volume mounts and data persistence, docker build failures (layer caching, npm install issues), healthchecks and service startup ordering (depends_on), environment variables in containers, port mapping, container crashes and exit codes (OOM/137), non-root users, multi-stage builds, image optimization, .dockerignore, and deploying to container runtimes. Takes priority over general implementation or debugging skills when Docker infrastructure is the subject."
---

# Docker

Project-specific containerization patterns for Dockerfile and Docker Compose.

## Architecture Decisions

### Image Building
1. **Minimal base images** — Use slim/alpine variants; pin to digest for reproducibility.
2. **Multi-stage builds** — Separate build dependencies from runtime.
3. **Layer optimization** — Combine RUN commands; place frequently changed files last.
4. **COPY over ADD** — ADD only for tar extraction or remote URLs.

### Security
5. **Non-root users** — Always use UID >10000; never run as root in production.
6. **No secrets in images** — Use Docker secrets or runtime env injection.
7. **.dockerignore required** — Exclude .git, .env, node_modules, build artifacts.

### Runtime
8. **One process per container** — Single responsibility principle.
9. **Healthchecks required** — Define HEALTHCHECK in Dockerfile or Compose.
10. **Resource limits** — Always set mem_limit and cpus in production.

### Compose
11. **Network segmentation** — Dedicated networks per service group.
12. **Named volumes** — Never use anonymous volumes in production.
13. **depends_on with healthchecks** — Use `condition: service_healthy`.
14. **Environment separation** — Use override files for dev/staging/prod.

## Gotchas

- `COPY . .` before `RUN npm install` busts the cache on EVERY code change. Copy `package*.json` first, install, THEN copy source.
- Alpine uses musl libc, not glibc. Python packages with C extensions (numpy, pandas, cryptography) may fail to install or need `apk add` build dependencies. Consider `-slim` variants if you hit this.
- `ENTRYPOINT ["python", "app.py"]` (exec form) handles signals correctly. `ENTRYPOINT python app.py` (shell form) wraps in `/bin/sh -c` and PID 1 won't receive SIGTERM — containers take 10s to stop.
- Docker layer cache is invalidated from the FIRST changed layer downward. A changed `COPY` near the top rebuilds everything below it.
- `depends_on` without `condition: service_healthy` only waits for container START, not readiness. Your app will crash connecting to a database that's still initializing.
- `host.docker.internal` works on Docker Desktop (Mac/Windows) but NOT on Linux. Use `--network host` or explicit container networking on Linux.
- Build args (`ARG`) are NOT available after `FROM` in multi-stage builds unless re-declared. Each stage starts fresh.
- `docker compose up` reuses existing containers. After changing `Dockerfile`, you need `docker compose up --build` or `docker compose build` first.
- Volume mounts override the container's filesystem — if your `node_modules` are built inside the container but you mount `.:/app`, the host's (possibly empty) `node_modules` shadows them. Use a named volume for `node_modules`.
- `EXPOSE` is documentation only — it does NOT publish the port. You still need `-p 8080:8080` or `ports:` in compose.
- Docker's default bridge network does NOT provide DNS resolution between containers. Use a custom network or compose's default network.

## References

| When you need... | Read |
|------------------|------|
| Dockerfile patterns, CMD vs ENTRYPOINT | [dockerfile.md](./references/dockerfile.md) |
| Compose services, networks, volumes | [compose.md](./references/compose.md) |
| Security hardening | [security.md](./references/security.md) |
| Production deployment | [production.md](./references/production.md) |

Attribution

avibebuilderavibebuilder
View sourceSee grades on GitHubMore from avibebuilder →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698621 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →