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

Docker best practices: image security, build efficiency, runtime hardening, Compose, local tooling (Colima, OrbStack). Use when writing or reviewing Dockerfiles and Compose files.

54 stars
0 votes
0 copies
0 views
Added 10/5/2026
devopsnodedockerkubernetesgitsecurity

Security Analysis

A100/100

Scanned 10/5/2026

$npx -y skills add SumonMSelim/agentguard --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/sumonmselim-docker/badge)](https://www.skillsdirectory.com/skills/sumonmselim-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
tags: []
description: Docker best practices: image security, build efficiency, runtime hardening, Compose, local tooling (Colima, OrbStack). Use when writing or reviewing Dockerfiles and Compose files.
license: MIT
---

# Docker

## Image security
- Never run as root. Prefer images with built-in non-root user: distroless `nonroot`, `node` user in Node images, `nobody` in Alpine. Otherwise add non-root user and switch: `USER appuser`
- Minimal base: `distroless`, `alpine`, or official slim variants
- Pin by digest or immutable tag. Never `FROM node:latest` or `image: myapp:latest` in Compose
- Multi-stage builds: build in full image, copy only artifact to minimal runtime image
- No build tools in final image
- Scan with Trivy or Grype in CI. Fail on critical/high CVEs
- Multi-arch: build with `--platform linux/amd64,linux/arm64` for cross-platform targets

## Dockerfile
- One process per container
- Enable BuildKit: `DOCKER_BUILDKIT=1`. Use `--mount=type=cache` for dependency caches, `--mount=type=secret` for build-time secrets
- `COPY` specific files. Avoid `COPY . .` when targeted copy suffices
- Layer order: least → most frequently changed. `COPY package.json` before `COPY src/`
- `.dockerignore`: exclude `.git`, `node_modules`, test files, secrets, `.env`
- Explicit `WORKDIR`. No implicit root working dir
- `ENTRYPOINT` for executable, `CMD` for default args
- No secrets in `ENV`, `ARG`, or `RUN` — persist in layer history. Use `--mount=type=secret`
- `HEALTHCHECK` on all long-running services

## Runtime
- Read-only root filesystem where possible: `--read-only`
- Drop all capabilities, re-add only what's needed: `--cap-drop ALL --cap-add NET_BIND_SERVICE`
- No `--privileged` in production
- Set resource limits: `--memory`, `--cpus`
- Named volumes for persistent data. No bind mounts in production
- No secrets via env vars. Use Docker secrets or mounted secret files
- Log rotation: set `--log-opt max-size=10m --log-opt max-file=3`. Unbounded logs fill disks

## Compose
- `compose.yml` for local dev only. Production: Kubernetes, ECS, or equivalent
- Explicit dependencies: `depends_on` + `condition: service_healthy`
- Named volumes for persistent data. Never rely on container filesystem
- `env_file` for local config. Never commit `.env` with real secrets
- `restart: unless-stopped` for crash-resilient services
- Custom networks per service group. Avoid default bridge
- `profiles:` for optional services (e.g. debug tools, mock servers). Keep default startup lean

## Maintenance
- `docker system prune -f` regularly. Dangling images and stopped containers accumulate fast
- `docker image prune -a` to remove unused images. Run in CI after builds
- Inspect layer bloat with `dive` before pushing large images

## Local tooling
- **Colima**: `colima start --cpu 4 --memory 8 --disk 60`. Default VM is undersized
- Switch context after start: `docker context use colima`
- `colima stop` when not in use. Idle VM still consumes resources
- **OrbStack**: preferred on Apple Silicon — lower memory overhead, faster mounts
- Both are license-free alternatives to Docker Desktop for teams
- Lima/Colima: use `~/.lima/<profile>` for multiple VM profiles (e.g. `arm64`, `rosetta`)

Attribution

SumonMSelimSumonMSelim
View sourceSee grades on GitHubMore from SumonMSelim →
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

Terraform Module Library

Build reusable Terraform modules for AWS, Azure, and GCP infrastructure following infrastructure-as-code best practices. Use when creating infrastructure modules, standardizing cloud provisioning, or implementing reusable IaC components.

401991 votes

sematext-otel

Wire a service's OpenTelemetry output to Sematext Cloud. Walks through region, App-type, instrumentation flow (managed OTLP endpoint vs Sematext Agent), and signal selection (traces/metrics/logs), then produces the exact env-var block and points at a runnable reference example in this repo. Invoke when instrumenting a new app for Sematext.

01 votes

Deployment Patterns

Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications. Use when setting up deployment infrastructure or planning releases.

2699140 votes

Babysit

Watch a pull request or review cycle until it is ready to merge. Use when asked to babysit, monitor, or keep checking PR comments, reviews, and CI until all actionable issues are resolved.

971540 votes

V7 Roster

Interact with the Paperclip control plane API for task coordination and governance. Use when checking assignments, updating issue status, posting comments, delegating work, managing routines, or calling Paperclip API endpoints.

953190 votes
View all in devops →