ClaudeDockerPerformance
Docker Claude Rules
Claude rules for Docker: layer caching, multi-stage builds, image security, and container optimization.
CLAUDE.md
- Structure Dockerfile to maximize layer cache hits: deps first, code last - Use BuildKit features (--mount=type=cache) to cache package manager downloads - Build separate dev and prod images from the same Dockerfile using targets - Use dive or docker-slim to analyze and minimize image size - Scan images with trivy or grype in CI before pushing to registry - Use COPY --chown to set file ownership instead of separate RUN chown - Set WORKDIR before COPY to establish a clean working directory - Use OCI labels for image metadata (source, version, description)
How to use with Claude
Create a `CLAUDE.md` file in your project root. Claude Code reads this on startup and follows your conventions throughout the session.
#docker#containers#claude#devops#coding-rules
Related Rules
React Claude Rules
ClaudeReact
Claude rules for React: component design, state patterns, performance, and testing conventions in CLAUDE.md.
Architecture
react · claudeCopy Ready
Next.js Claude Rules
ClaudeNext.js
Claude rules for Next.js App Router: streaming, server actions, caching, and production deployment patterns.
Architecture
nextjs · claudeCopy Ready
Go Claude Rules
ClaudeGo
Claude rules for Go: project structure, error handling, testing, and idiomatic Go patterns.
Architecture
go · golangCopy Ready
Rust Claude Rules
ClaudeRust
Claude rules for Rust: zero-cost abstractions, async with Tokio, error types, and high-performance Rust patterns.
Performance
rust · tokioCopy Ready