Skip to content
Back to skills

Docker Best Practices

ASecurity

Docker expert — image optimization, security hardening, multi-stage builds, orchestration, production deployment. Use when writing or reviewing Dockerfiles, Compose, or container deploys.

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 9, 2026
ai-agentsgoshelldockerkubernetesawstestinggitdatabasedevopsci/cd

Security analysis

A100/100

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

Scanned October 9, 2026

npx -y skills add HigorAlves/orc --skill docker-best-practices --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Docker Best Practices?

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

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

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: docker-best-practices
description: "Docker expert — image optimization, security hardening, multi-stage builds, orchestration, production deployment. Use when writing or reviewing Dockerfiles, Compose, or container deploys."
category: devops
risk: unknown
source: community
date_added: "2026-02-27"
---

# Docker Expert

Advanced Docker containerization expertise: container optimization, security hardening, multi-stage builds, orchestration patterns, and production deployment based on current industry best practices.

## When to use

Use this skill when writing, optimizing, or reviewing Docker setups — Dockerfiles, `.dockerignore`, Docker Compose, multi-stage builds, image-size reduction, container security, resource limits, health checks, or production container deployment.

## When NOT to use (recommend switching and stop)

If the issue requires ultra-specific expertise outside Docker, recommend switching and stop:

- Kubernetes orchestration, pods, services, ingress → kubernetes-expert (future)
- GitHub Actions CI/CD with containers → github-actions-expert
- AWS ECS/Fargate or cloud-specific container services → devops-expert
- Database containerization with complex persistence → database-expert

Example to output:
"This requires Kubernetes orchestration expertise. Please invoke: 'Use the kubernetes-expert subagent.' Stopping here."

## Workflow

1. **Analyze** the container setup comprehensively (environment detection, project structure, running containers). See `references/production-deploy.md`. Prefer internal tools (Read, Grep, Glob) over shell; shell is a fallback.
2. **Identify** the specific problem category and complexity level (see the index below).
3. **Apply** the appropriate solution strategy from the relevant reference file.
4. **Validate** thoroughly (build, security scan, runtime, Compose config). See `references/production-deploy.md`.

Read the relevant `references/<topic>.md` file when you need that detail — each file holds the patterns, code review checklist items, and diagnostics for that topic. For a partial task, load only the references you need.

## Topic index

| Topic | When you need it | Reference |
|-------|------------------|-----------|
| Multi-stage builds & layer caching | Optimizing Dockerfiles, dependency caching, cross-platform/buildx, base image selection | `references/multistage-builds.md` |
| Image size optimization | Distroless, artifact selection, layer consolidation, shrinking large images | `references/image-optimization.md` |
| Security hardening | Non-root users, secrets management, build-time secrets, health checks, attack surface | `references/security-hardening.md` |
| Compose & dev workflow | Docker Compose orchestration, service deps, networks, volumes, hot-reload dev overrides | `references/compose.md` |
| Performance, resources & networking | Resource limits, restart policies, service discovery, networking issues, expert handoff | `references/orchestration.md` |
| Production deploy, validation & diagnostics | Environment detection, build/runtime/Compose validation, full diagnostics catalog | `references/production-deploy.md` |

## Core philosophy

Comprehensive Docker containerization with focus on practical optimization, security hardening, and production-ready patterns. Solutions emphasize performance, maintainability, and security best practices for modern container workflows.

## Limitations

- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

Files in this skill

  • SKILL.md3.6 KB
  • references/compose.md3.3 KB
  • references/image-optimization.md1.1 KB
  • references/multistage-builds.md2.4 KB
  • references/orchestration.md2 KB
  • references/production-deploy.md2.8 KB
  • references/security-hardening.md1.8 KB

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.

Comments

Loading comments…