docker — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited docker (Agent Skill) and scored it 96/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 1 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
You are in AUTONOMOUS MODE. Do NOT ask questions. Do NOT pause for confirmation. Execute every phase below in sequence, making decisions based on what you find.
============================================================ PHASE 0 — INPUT ============================================================
$ARGUMENTS may contain:
--compose — also generate docker-compose.yml (default: auto-detect need)--dev — include development compose profile with hot reload--prod — optimize for production (smaller image, no dev deps)--registry <url> — target container registry (default: ghcr.io)--slim — use Alpine/distroless base images for minimal sizeIf no arguments, generate both Dockerfile and docker-compose.yml if the project has dependencies (database, cache, etc.).
============================================================ PHASE 1 — STACK DETECTION ============================================================
Detect the application stack by reading manifest files:
Node.js:
package.json for: engines.node, scripts.start, scripts.build, frameworkpackage-lock.json (npm), yarn.lock (yarn), pnpm-lock.yaml (pnpm)next.config.*), Fastify, Express, NestJS, Remix, Astrotsconfig.json — TypeScript build step neededPython:
pyproject.toml, requirements.txt, Pipfile, setup.pymanage.py), Flask, FastAPI (uvicorn/gunicorn).python-version, pyproject.toml, or runtime.txtGo:
go.mod for module name and Go versioncmd/main.go or main.go entry pointRust:
Cargo.toml for binary nameJava:
pom.xml (Maven) or build.gradle (Gradle)Ruby:
Gemfile for Ruby version and framework (Rails, Sinatra)config.ru (Rack app)Also detect dependencies that need compose services:
============================================================ PHASE 2 — GENERATE DOCKERFILE ============================================================
Create a multi-stage Dockerfile following these principles:
Stage 1 — Dependencies (deps or builder):
latest (e.g., node:22-alpine, python:3.12-slim)--mount=type=cache for package manager caches where supportedStage 2 — Build (if applicable):
npm run build, go build, cargo build --release)Stage 3 — Production:
node:22-alpine (or distroless if --slim)python:3.12-slimgcr.io/distroless/static-debian12 or scratchgcr.io/distroless/cc-debian12 or scratcheclipse-temurin:21-jre-alpineruby:3.3-slimWORKDIR /appSecurity hardening (always apply):
USER appuser before CMDapt-get upgrade — pin base image version insteadHealth check (always include):
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3wget --no-verbose --tries=1 --spider http://localhost:${PORT}/health || exit 1curl -f http://localhost:${PORT}/health || exit 1Labels (OCI standard):
LABEL org.opencontainers.image.source="https://github.com/OWNER/REPO"
LABEL org.opencontainers.image.description="Description"Environment:
NODE_ENV=production or equivalentPORT and EXPOSE it============================================================ PHASE 3 — GENERATE .dockerignore ============================================================
Create .dockerignore to minimize build context. Always exclude:
.git directory.vscode, .idea)coverage, .nyc_output, .pytest_cache).env*)node_modules (rebuilt inside container)*.md)Adjust patterns based on detected stack.
============================================================ PHASE 4 — GENERATE DOCKER COMPOSE ============================================================
Create docker-compose.yml if the application has external dependencies or --compose is set.
Structure requirements:
version: field (Docker Compose V2+ does not need it)depends_on with condition: service_healthy for startup ordering${VAR:-default} for configurable valuesrestart: unless-stopped on all servicesDatabase services: Include proper health checks:
pg_isready -U postgresmysqladmin ping -h localhostmongosh --eval "db.runCommand('ping')"Cache services: Include memory limits and eviction policy configuration.
Development profile (if --dev): Create a docker-compose.dev.yml override with:
NODE_ENV=development or equivalent============================================================ PHASE 5 — VALIDATION ============================================================
After generating files, verify:
latest============================================================ SELF-HEALING VALIDATION (max 2 iterations) ============================================================
After completing deployment/infrastructure changes, validate:
IF STILL FAILING after 2 iterations:
============================================================ OUTPUT ============================================================
Print a summary:
## Docker Setup Complete
### Files Created
- Dockerfile — Multi-stage build ({base image}, {final size estimate})
- .dockerignore — {N} patterns to minimize build context
- docker-compose.yml — Services: {list}
- docker-compose.dev.yml — Development overrides (if generated)
### Build Commands
- Production: docker compose up --build -d
- Development: docker compose -f docker-compose.yml -f docker-compose.dev.yml up
- Image only: docker build -t {name}:latest .
### Image Details
- Base: {base image}
- Estimated size: {size estimate}
- User: appuser (non-root, UID 1001)
- Health check: {endpoint}
- Exposed port: {port}
### Services
| Service | Image | Port | Volume |
|---------|-------|------|--------|
| app | built | {port} | -- |
| db | postgres:16 | 5432 | db-data |============================================================ NEXT STEPS ============================================================
docker compose up --build/health endpoint to the application if one does not existdeploy/github-actions)deploy/secrets)============================================================ SELF-EVOLUTION TELEMETRY ============================================================
After producing output, record execution metadata for the /evolve pipeline.
Check if a project memory directory exists:
~/.claude/projects/skill-telemetry.md in that memory directoryEntry format:
### /docker — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}Only log if the memory directory exists. Skip silently if not found. Keep entries concise — /evolve will parse these for skill improvement signals.
============================================================ DO NOT ============================================================
latest tag for base images — pin to specific versions.env files into the image — use environment variables at runtimeADD when COPY suffices (ADD has implicit tar extraction and URL fetch)apt-get upgrade — use a pinned base image instead--mount=type=cache or clean up)~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.