- Home
- Skills
- DevOps & Cloud
- Docker & Compose Production Linter
Works with the AI Agents you already use
Docker & Compose Production Linter
Audit Dockerfiles and Compose files for root containers, leaked secrets, missing healthchecks, and unsafe privileges—with a zero-dependency read-only Python linter and approval-gated hardened diffs.
Free
Docker & Compose Production Linter
Example session with this skill installed
Audit our Dockerfile and docker-compose.yml for production readiness before we deploy our Node.js + Postgres + Redis app. Flag critical security issues first and show hardened fixes before editing any files.
- Read your context and instructions
- Compiled the docker & compose
Docker & Compose Production Readiness Report
Verdict: FAIL · Grade: F (0/100) · Findings: 3 Critical, 4 High, 5 Medium, 1 Low
| Rule | Severity | Location | Finding | Remediation |
|---|---|---|---|---|
DKR-002 | Critical | Dockerfile:1 | Final stage runs as root (no non-root USER) | Add dedicated non-root USER 1001:1001 |
DKR-003 | Critical | Dockerfile:6 | Credential-like literal in ENV API_SECRET=[REDACTED] | Remove from image; inject at runtime via secrets |
CMP-001 | Critical | docker-compose.yml:14 | Service api sets privileged: true | Remove privileged: true; add cap_drop: [ALL] |
CMP-002 | Critical | docker-compose.yml:18 | Docker socket /var/run/docker.sock mounted into app | Remove host socket mount immediately |
CMP-004 | High | docker-compose.yml:29 | Postgres port 5432:5432 exposed on all interfaces | Bind to 127.0.0.1:5432:5432 or internal network only |
DKR-004 | High | Dockerfile:1 | Missing HEALTHCHECK in final stage | Add lightweight HTTP /healthz check |
Proposed Hardened Dockerfile (Multi-Stage, Non-Root)
FROM node:20.18.1-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:20.18.1-alpine AS runner
WORKDIR /app
RUN addgroup -S app && adduser -S app -G app
COPY --from=builder --chown=app:app /app/dist ./dist
COPY --from=builder --chown=app:app /app/node_modules ./node_modules
USER app
HEALTHCHECK --interval=30s --timeout=3s CMD wget -qO- http://127.0.0.1:3000/healthz || exit 1
CMD ["node", "dist/server.js"]
Next Steps (Approval Required)
- Rotate any credentials previously baked into image layers.
- Reply
"Apply hardened patches" to write the updated Dockerfile, docker-compose.yml, and .dockerignore (bringing the stack to
Grade A / 100/100).
Connects securely to your tools. The creator never sees your data.
About this skill
Stop Shipping Insecure Containers to Production
Docker & Compose Production Linter gives your AI coding agent a senior DevOps review workflow plus a zero-dependency, strictly read-only Python static analyzer (scripts/lint_docker.py) that catches 17 high-impact container misconfigurations with exact file paths, line numbers, and PR-ready hardened patches.
What It Catches (17 Deterministic Rules)
- Dockerfile Hardening (
DKR-001–DKR-009): Unpinned:latestbase images, missing non-rootUSER, baked-in secrets inENV/ARG(automatically[REDACTED]), missingHEALTHCHECK, unsafeADDusage, bloatedapt-getlayers, pipedcurl | shinstalls, missing.dockerignore, and heavy single-stage builds. - Docker Compose Safety (
CMP-001–CMP-008):privileged: true, mounted/var/run/docker.sock,network_mode: host/pid: host, publicly exposed database/cache ports (0.0.0.0:5432), missingrestartpolicies or resource limits, missing service healthchecks, hardcoded inline credentials, and unpinned image tags.
How to Use
Ask your AI agent naturally in any repo containing a Dockerfile or docker-compose.yml:
- "Audit my Dockerfile and docker-compose.yml for production readiness."
- "Harden our container stack before deploying to production—show me the risk scorecard first."
- "Check if our Docker setup has root containers, exposed DB ports, or secret leaks."
Or run the bundled read-only analyzer directly:
python3 scripts/lint_docker.py --path . --format markdown
What's Inside (16 Files)
SKILL.md— Deterministic 5-step audit workflow with A–F readiness grading and explicit approval gate before any file editscripts/lint_docker.py— Pure Python 3 stdlib static analyzer (zero pip installs, JSON & Markdown output,--fail-onCI gate)references/— Dockerfile hardening guide, Compose production checklist, and full 17-rule catalogtemplates/— Executive audit report & approval-gated hardened patch planexamples/— Worked Node.js + Postgres + Redis before/after audittests/— Vulnerable & hardened fixtures plus runnable unit tests
Security & Privacy Guarantee
- 100% read-only by default — never modifies files without your explicit confirmation.
- Zero
.envreading, zero network calls, zero shell execution inside the analyzer script. - Any suspected credential value is automatically masked as
[REDACTED].
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.
Performs static analysis on Dockerfile and Docker Compose YAML files; does not inspect live Docker daemon runtime state or binary image layers.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 2 days ago
- Free with an Agensi account
- Software
Python 3.9+ (stdlib only)
Permissions
Bundled analyzer is 100% read-only with zero network or env-var access. Write Files is only used after explicit user approval to apply hardened diffs.