Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/nedcodes-ok/cursor-doctor/dockergit clone --depth 1 https://github.com/nedcodes-ok/cursor-doctorWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00823 | $0.00823 |
| Opus 5 | $0.00411 | $0.00411 |
| Sonnet 5 | $0.00165 | $0.00165 |
| Haiku 4.5 | $0.00082 | $0.00082 |
Grade A, and why
docker scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Asks for rootlowPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
- Never run as root: `RUN addgroup -S app && adduser -S app -G app` then `USER app` before CMD. Root in a container = root on the host if there's an escape Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
How it starts
The opening of the file, as written. The whole thing — 42 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Docker Cursor Rules
You are an expert Docker developer. Follow these rules:
Dockerfiles
- Use specific base image tags (
node:20-alpine, notnode:latest) — latest changes without warning and breaks builds - Order layers from least to most frequently changing: OS deps → language deps → build tools → application code. Each change invalidates all layers after it
- Multi-stage builds to reduce final image size: build stage with dev dependencies, production stage copies only the compiled output. A Node.js app can go from 1GB to 150MB
- Copy dependency files first, install, then copy source:
COPY package*.json ./→RUN npm ci→COPY . .— this caches the expensive install step when only source code changes .dockerignoreis not optional: excludenode_modules,.git,*.md,.env, test files — without it, your build context is huge and cache invalidation is unpredictableRUN npm cinotRUN npm install— ci uses the lockfile exactly, install might update it
Security
- Never run as root:
RUN addgroup -S app && adduser -S app -G appthenUSER appbefore CMD. Root in a container = root on the host if there's an escape - Secrets never in the image: no
ENV SECRET=..., noCOPY .env .— use runtime env vars, Docker secrets, or mounted config files - Scan images with Trivy or Snyk in CI — vulnerabilities in base images are your vulnerabilities
- Minimal base images:
alpine(5MB),distroless(no shell at all), orslimvariants. Full Debian/Ubuntu images carry hundreds of unnecessary packages HEALTHCHECKinstruction so Docker knows when your container is actually ready, not just running. Without it, a crashed app inside a "running" container gets no restart
Compose
- Named volumes for persistent data (
db-data:) — anonymous volumes get garbage collected and your data disappears - Resource limits on every service:
deploy.resources.limits.memory: 512M— one runaway container shouldn't OOM the entire host depends_onwithcondition: service_healthy(not justservice_started) to wait for actual readiness — database containers start fast but take seconds to accept connections.envfiles for configuration, but never commit them — use.env.examplewith placeholder valuesrestart: unless-stoppedfor production services —alwaysrestarts even when you manually stop, which is annoying during debugging
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 42 lines · 823 tokens per session scan A aca5eaa31be8
docker is a cursor rule published in the GitHub repository nedcodes-ok/cursor-doctor (9 stars, last pushed 5mo ago), licensed MIT. It adds 823 tokens to every session, about $0.0041 per session on Opus 5. A static security scan graded it A with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
angular
Angular: signals, standalone components, RxJS patterns.
django
Django: models, views, ORM best practices.
java
Modern Java: records, sealed classes, streams, virtual threads.
javascript
Modern JavaScript: ES2023+, async patterns, common traps.
rust
Rust patterns: ownership, Result types, iterators.
accessibility
Accessibility: semantic HTML, ARIA, keyboard navigation, testing.