Docker
SkillFiles & storageDocker best practices: image security, build efficiency, runtime hardening, Compose, local tooling (Colima, OrbStack). Use when writing or reviewing Dockerfiles and Compose files.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Docker skill
What this skill tells your AI
The instructions your AI receives, as published by sumonmselim/agentguard in skills/docker/SKILL.md and read by ahel’s review.
Image security
- Never run as root. Prefer images with built-in non-root user: distroless
nonroot,nodeuser in Node images,nobodyin 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:latestorimage: myapp:latestin 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/arm64for cross-platform targets
Dockerfile
- One process per container
- Enable BuildKit:
DOCKER_BUILDKIT=1. Use--mount=type=cachefor dependency caches,--mount=type=secretfor build-time secrets COPYspecific files. AvoidCOPY . .when targeted copy suffices- Layer order: least → most frequently changed.
COPY package.jsonbeforeCOPY src/ .dockerignore: exclude.git,node_modules, test files, secrets,.env- Explicit
WORKDIR. No implicit root working dir ENTRYPOINTfor executable,CMDfor default args- No secrets in
ENV,ARG, orRUN— persist in layer history. Use--mount=type=secret HEALTHCHECKon 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
--privilegedin 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.ymlfor 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_filefor local config. Never commit.envwith real secretsrestart: unless-stoppedfor 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 -fregularly. Dangling images and stopped containers accumulate fastdocker image prune -ato remove unused images. Run in CI after builds- Inspect layer bloat with
divebefore 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 stopwhen 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)
Signals
- GitHub stars
- 56
- Forks
- 11
- Last commit
- Jul 2026
ahel review
S4info
community integration — published by sumonmselim, not docker
Automated review, not a security audit. Ruleset v1+k2.
Advanced
- Catalog kind
- skill
- Gateway key
docker-sumonmselim- Source
- github.com/sumonmselim/agentguard