Skip to content
Back to skills

Using Docker

ASecurity

Use when writing or editing a Dockerfile or Docker Compose file for production images. Triggers on `Dockerfile`, `docker-compose.yml`, `.dockerignore`, multi-stage builds, base images, slow builds, large images, non-root users, BuildKit secrets, or health checks, even when the user doesn't say 'Docker'.

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
ai-agentsgodockersecurity

Security analysis

A100/100

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

Scanned November 30, 2026

npx -y skills add xonovex/platform --skill using-docker --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Using Docker?

Add the live security badge to your README. It updates with every re-scan.

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

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

Download with Pro
SKILL.md
---
name: using-docker
description: "Use when writing or editing a Dockerfile or Docker Compose file for production images. Triggers on `Dockerfile`, `docker-compose.yml`, `.dockerignore`, multi-stage builds, base images, slow builds, large images, non-root users, BuildKit secrets, or health checks, even when the user doesn't say 'Docker'."
---

# Docker Coding Guidelines

Build small, reproducible Docker images with explicit runtime permissions and validated health behavior.

## Essentials

- **Build optimization** - Multi-stage builds, small base images (alpine/distroless), see [references/multi-stage-builds.md](references/multi-stage-builds.md)
- **Security** - Least privilege, externalize secrets (never in images), see [references/security.md](references/security.md)
- **Configuration** - Externalize config via env/volumes, pin versions, see [references/production-config.md](references/production-config.md)
- **Quality** - Use BuildKit and hadolint, see [references/production-config.md](references/production-config.md)

## Gotchas

- Multi-stage builds need explicit `COPY --from=<stage>`: forgetting it copies the whole heavy stage into the final image
- `ENTRYPOINT` + `CMD` interact: `CMD` provides default args to `ENTRYPOINT`; overriding `CMD` from `docker run` drops them, not appends

## Progressive disclosure

- Read [references/multi-stage-builds.md](references/multi-stage-builds.md) - Load when creating production images or optimizing build process
- Read [references/security.md](references/security.md) - Load when hardening images or handling secrets
- Read [references/production-config.md](references/production-config.md) - Load when adding health checks or configuring for orchestration
- Read [references/docker-compose.md](references/docker-compose.md) - Load when defining multi-service local development environments

Files in this skill

  • SKILL.md1.8 KB
  • eval-output.json3.2 KB
  • eval-trigger.json5.6 KB
  • moon.yml86 B
  • references/docker-compose.md786 B
  • references/multi-stage-builds.md681 B
  • references/production-config.md410 B
  • references/security.md462 B
  • sources.json929 B

Attribution

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

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.