docker-best-practices
Docker best practices including multi-stage builds, compose patterns, image optimization, and security
npx skills add rohitg00/awesome-claude-code-toolkit --skill docker-best-practices --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Docker Best Practices ## Multi-Stage Build ```dockerfile FROM node:22-alpine AS deps WORKDIR /app COPY package.json package-lock.json ./ RUN npm ci --only=production FROM node:22-alpine AS build WORKDIR /app COPY package.json package-lock.json ./ RUN npm ci COPY . . RUN npm run build FROM node:22-alpine AS runtime WORKDIR /app RUN addgroup -g 1001 -S appgroup && adduser -S appuser -u 1001 -G appgroup COPY --from=deps /app/node_modules ./node_modules COPY --from=build /app/dist ./dist COPY --from=build /app/package.json ./ USER appuser EXPOSE 3000 HEALTHCHECK --interval=30s --timeout=3s CMD wget -qO- http://localhost:3000/healthz || exit 1 CMD ["node", "dist/server.js"] ``` Separate dependency installation from build steps. Final stage contains only runtime artifacts. ## Python Multi-Stage ```dockerfile FROM python:3.12-slim AS builder WORKDIR /app RUN python -m venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt FROM python:3.12-slim WORKDIR /app RUN useradd --create-home appuser COPY --from=builder /opt/venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" COPY . . USER appuser CMD ["gunicorn", "app:create_app()", "-b"
- Multi-Stage Build
- Python Multi-Stage
- Docker Compose
- .dockerignore
- Image Optimization Tips
- Anti-Patterns
- Checklist
Check image size breakdown docker history --human --no-trunc <image> Use dive for layer analysis dive <image> Multi-arch build docker buildx build --platform linux/amd64,linux/arm64 -t registry/app:1.0 --push .
What does the docker-best-practices skill do?
Docker best practices including multi-stage builds, compose patterns, image optimization, and security
How do I install it?
Run `npx skills add rohitg00/awesome-claude-code-toolkit --skill docker-best-practices --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From rohitg00/awesome-claude-code-toolkit, a repository with 2,438 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.