agentleFS
kumaran-iskumaran-is/claude-code-onboarding/.claude/skills/docker/SKILL.md

docker

Skill36 starsChanged 6 months agoMITView on GitHub

Use when writing or reviewing Dockerfiles, docker-compose files, or .dockerignore for any backend service. Covers multi-stage builds, container security hardening, compose orchestration, advanced build patterns, and a Docker review checklist for all 4 stacks: NestJS/Node 24, Spring Boot WebFlux 3.5.x/Java 21, Python FastAPI 3.14, and TypeScript/Fastify/Node 24.

47 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ansible, kubernetes and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • KubementatSkill

    ansible

    Ansible automation reference for playbooks, roles, inventory, variables, and modules. Includes Proxmox VE and Docker integration via community.general and community.docker collections. Use when writing playbooks, troubleshooting Ansible runs, or designing automation workflows. Triggers: ansible, playbook, inventory, role, task, handler, vars, jinja2, galaxy, proxmox_kvm, proxmox_lxc, docker_container, docker_compose.

    Also in 3 projects that use this

  • mjunaidcaSkill

    kubernetes

    Production-grade Kubernetes manifests and debugging for containerized applications. This skill should be used when users ask to deploy to Kubernetes, create K8s manifests, containerize for K8s, set up Deployments/Services/Jobs/StatefulSets/CronJobs, create namespaces with resource quotas, set up multi-team isolation, configure ResourceQuota/ LimitRange, secure with RBAC (ServiceAccount, Role, RoleBinding), configure init containers (model download, db wait, migrations), set up sidecars (logging, metrics), or debug pods (CrashLoopBackOff, logs, exec, describe, events). Auto-detects from Dockerfile/code, generates hardened manifests with educational comments. CKAD-aligned.

    Also in 6 projects that use this

  • mjunaidcaSkill

    helm

    Production-grade Helm 4 chart development, release management, and debugging. This skill should be used when users ask to create Helm charts, deploy with Helm, manage releases (install/upgrade/rollback), push charts to OCI registries, debug failed deployments, configure chart dependencies, create umbrella charts, set up GitOps with ArgoCD/Flux, or troubleshoot Helm issues. Auto-detects from Dockerfile/code, generates production-hardened charts with library patterns. Complements kubernetes skill.

    Also in 3 projects that use this

  • LangChainSkill

    langchain

    Build agents with a prebuilt architecture and integrations for any model or tool. Use when creating tool-calling agents, switching model providers, or adding structured output.

    Also in 3 projects that use this

  • diego-tobalinaSkill

    logging

    Logging best practices for Java (SLF4J/Logback) and Node.js (Winston/Pino). Use for structured logging, log levels, and avoiding sensitive data exposure.

    Also in 4 projects that use this

  • ihiteshguptaSkill

    terraform

    Expert in Infrastructure as Code with Terraform. Use for creating, managing, and versioning infrastructure across cloud providers.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 42 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read reference/dockerfiles.md for the complete, copy-ready Dockerfile for your stack:

    line 47
  2. Very specific:

    Read assets/docker-review-checklist.md before committing any Dockerfile or compose file.

    line 77
  3. Distinctive:

    Build fails with "not found" or permission error: Check .dockerignore is not excluding required files.

    line 90
  4. Distinctive:

    Container exits immediately: Check HEALTHCHECK target path matches the actual health endpoint.

    line 94
  5. Very specific:

    docker-compose: service fails to connect to database: Verify depends_on: condition: service_healthy is set.

    line 96

“Common” is measured: kept by at least 6 in 10 of the 42 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Iron Law

NO DOCKERFILE WITHOUT READING reference/dockerfiles.md FIRST — each stack has specific base images, build tools, and health check patterns that must be used exactly

Docker

Production-ready containerization for NestJS/Node 24, Spring Boot WebFlux 3.5.x/Java 21, Python FastAPI 3.14, and TypeScript/Fastify/Node 24. All patterns follow: multi-stage build, non-root user, HEALTHCHECK, .dockerignore.

When to Use

  • Writing a Dockerfile for any backend service
  • Writing or updating docker-compose files for local dev or production
  • Reviewing an existing Dockerfile for security, size, or correctness
  • Adding build cache optimization (--mount=type=cache)
  • Setting up Docker Compose secrets for production
  • Building multi-architecture images (linux/amd64 + linux/arm64)
  • Debugging container build failures, slow builds, or large image sizes

How This Skill Relates to Others

SkillScope
docker (this skill)Container definitions, compose files, build patterns
java-spring-apiJava application code — loads docker skill for Dockerfile
nestjs-apiNestJS templates include Dockerfile — this skill extends those patterns
python-devFastAPI code — loads docker skill for Dockerfile
agentic-ai-devPython agent code — has deployment reference that this skill augments

Process

Step 1: Choose the Right Dockerfile Pattern

Read reference/dockerfiles.md for the complete, copy-ready Dockerfile for your stack:

StackBase ImageBuild ToolPort
NestJS 11.x / Node 24node:24-alpinepnpm3000
Spring Boot WebFlux 3.5.xmaven:3.9-eclipse-temurin-21-alpine → eclipse-temurin:21-jre-alpineMaven8080
Python FastAPI 3.14python:3.14-slimuv8000
Python Agentic AIpython:3.14-slimuv + gunicorn8000
TypeScript/Fastify / Node 24node:24-alpinenpm3000

Step 2: Set Up Docker Compose

Read reference/compose-patterns.md for:

  • Development compose (PostgreSQL 17 + Redis 7)
  • Production compose with Docker secrets (_FILE env pattern)
  • Health check dependency ordering (condition: service_healthy)
  • Network isolation (internal backend network)
  • Resource limits and restart policies

Step 3: Apply Advanced Patterns (if needed)

Read reference/advanced-patterns.md for:

  • Build cache mounts (--mount=type=cache) for Maven, npm, pip/uv — cuts rebuild time significantly
  • Multi-architecture builds (docker buildx) for linux/amd64 + linux/arm64
  • Distroless runtime images for zero-CVE base
  • Build-time secrets (BuildKit --mount=type=secret)
  • Diagnostics: slow builds, large images, networking failures, hot-reload issues

Step 4: Review with Checklist

Read assets/docker-review-checklist.md before committing any Dockerfile or compose file. Covers 6 categories: optimization, security, compose, image size, dev workflow, networking.

Reference Files

FileContentLoad When
reference/dockerfiles.mdCopy-ready multi-stage Dockerfiles + .dockerignore for all 5 stack variantsWriting any new Dockerfile
reference/compose-patterns.mdDev compose (PostgreSQL+Redis), production compose with Docker secrets, health checks, networks, resource limitsWriting or reviewing docker-compose files
reference/advanced-patterns.mdBuild cache mounts (all stacks), multi-arch buildx, distroless images, build secrets, diagnosticsOptimizing builds or debugging container issues
assets/docker-review-checklist.md30-item Docker review checklist (6 categories) with stack-specific itemsBefore committing Dockerfile or compose changes

Error Handling

Build fails with "not found" or permission error: Check .dockerignore is not excluding required files. Verify COPY paths match actual project structure.

Image too large (>500MB for Node/Python, >300MB for Java runtime): Read reference/advanced-patterns.md section "Image Size Optimization" — switch to multi-stage if single-stage, or distroless runtime.

Container exits immediately: Check HEALTHCHECK target path matches the actual health endpoint. Verify USER directive comes after all COPY operations. Check CMD vs ENTRYPOINT usage.

docker-compose: service fails to connect to database: Verify depends_on: condition: service_healthy is set. Verify DATABASE_URL credentials match docker-compose environment values exactly.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.