Generates optimized multi-stage Dockerfiles and .dockerignore for any stack (.NET, Node, Python, Java, Go, Rust) with layer caching, small images, and non-root users.
Ships in AI for Developers Toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Produce a production-grade multi-stage Dockerfile for any app: fast cached builds, a small secure runtime image, and a non-root user.
Works on a target: a project/solution/repo or GitHub URL (clone first: git clone --depth 1 <url> /tmp/repo). If a Dockerfile exists, review and harden it instead of replacing it blindly.
| Manifest | Read | Build stage | Runtime stage (smallest sensible) |
|---|---|---|---|
*.csproj | <TargetFramework>, entry project, solution layout | mcr.microsoft.com/dotnet/sdk | aspnet:<ver>-noble-chiseled / runtime-deps (AOT) |
package.json + lock | engines.node, scripts.build/start, framework (Nest, Next, Express) | node:<ver>-slim | gcr.io/distroless/nodejs<ver>-debian12 or node:<ver>-slim + USER node |
pyproject.toml / requirements*.txt | Python version, uv/poetry/pip, ASGI/WSGI server | python:<ver>-slim | python:<ver>-slim + non-root user |
pom.xml / build.gradle(.kts) | Java version, wrapper (mvnw/gradlew), Spring Boot | eclipse-temurin:<ver>-jdk | eclipse-temurin:<ver>-jre or gcr.io/distroless/java<ver>-debian12 |
go.mod | Go version, main package path, cgo usage | golang:<ver> | gcr.io/distroless/static-debian12:nonroot (or scratch) |
Cargo.toml | binary name, native deps | rust:<ver> | gcr.io/distroless/cc-debian12:nonroot |
Use the runtime/language version the project already targets; don't invent tags - check the image exists for that version.
RUN --mount=type=cache,target=...) speed rebuilds further.nonroot do this; otherwise create one and USER it).latest in production.ENV/ARG secrets; use RUN --mount=type=secret for build-time and runtime injection for run-time..dockerignore; exec-form ENTRYPOINT so the process gets signals (PID 1) and shuts down gracefully.HEALTHCHECK only if the image has a tool to run it (distroless doesn't - use orchestrator probes, healthchecks-setup).# build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
COPY ["MyApp/MyApp.csproj", "MyApp/"]
RUN dotnet restore "MyApp/MyApp.csproj" # restore as its own layer = cached unless csproj changes
COPY . .
RUN dotnet publish "MyApp/MyApp.csproj" -c Release -o /app/publish /p:UseAppHost=false
# runtime (small + non-root)
FROM mcr.microsoft.com/dotnet/aspnet:9.0-noble-chiseled AS final
WORKDIR /app
COPY --from=build /app/publish .
USER $APP_UID # non-root (chiseled images set this)
EXPOSE 8080
ENTRYPOINT ["dotnet", "MyApp.dll"]
.csproj (plus Directory.Build.props, Directory.Packages.props, nuget.config) before restore.-chiseled (no shell, non-root, best default for services), -alpine (musl), -noble/standard. Native AOT + runtime-deps chiseled for tiny self-contained images when the app is AOT-compatible.dotnet publish /t:PublishContainer builds an image without a Dockerfile.FROM node:22-slim AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN --mount=type=cache,target=/root/.npm npm ci
COPY . .
RUN npm run build && npm prune --omit=dev
FROM gcr.io/distroless/nodejs22-debian12:nonroot
WORKDIR /app
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
COPY --from=build /app/package.json ./
ENV NODE_ENV=production
EXPOSE 8080
CMD ["dist/main.js"] # distroless node image's entrypoint is node
corepack enable, copy pnpm-lock.yaml, pnpm install --frozen-lockfile. yarn: yarn install --immutable.output: 'standalone' and copy .next/standalone + .next/static + public.node:22-slim as the runtime with USER node. Native modules must be built on the same libc as the runtime.FROM python:3.12-slim AS build
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv # pin this tag in production
WORKDIR /app
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
COPY pyproject.toml uv.lock ./
RUN --mount=type=cache,target=/root/.cache/uv uv sync --frozen --no-dev --no-install-project
COPY . .
RUN --mount=type=cache,target=/root/.cache/uv uv sync --frozen --no-dev
FROM python:3.12-slim
RUN useradd --create-home --uid 10001 app
WORKDIR /app
COPY --from=build --chown=app:app /app /app
ENV PATH="/app/.venv/bin:$PATH" PYTHONUNBUFFERED=1
USER app
EXPOSE 8080
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]
python -m venv /opt/venv, pip install --no-cache-dir -r requirements.txt in the build stage, copy /opt/venv. poetry: export to requirements or install into a venv with --only main.collectstatic in the build stage.FROM eclipse-temurin:21-jdk AS build
WORKDIR /src
COPY mvnw pom.xml ./
COPY .mvn .mvn
RUN --mount=type=cache,target=/root/.m2 ./mvnw -B dependency:go-offline
COPY src src
RUN --mount=type=cache,target=/root/.m2 ./mvnw -B package -DskipTests
FROM eclipse-temurin:21-jre
RUN useradd --uid 10001 app
WORKDIR /app
COPY --from=build /src/target/*.jar app.jar
USER app
EXPOSE 8080
ENTRYPOINT ["java", "-XX:MaxRAMPercentage=75", "-jar", "app.jar"]
gradlew, gradle/, settings.gradle(.kts), build.gradle(.kts) first; cache /root/.gradle; ./gradlew bootJar.java<ver>-debian12:nonroot is a smaller runtime option. Alternatives: Jib or Cloud Native Buildpacks (spring-boot:build-image) without a Dockerfile.MaxRAMPercentage, not a fixed -Xmx sized for a laptop.FROM golang:1.23 AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod go mod download
COPY . .
RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/app ./cmd/api
FROM gcr.io/distroless/static-debian12:nonroot
COPY --from=build /out/app /app
EXPOSE 8080
ENTRYPOINT ["/app"]
CGO_ENABLED=0 and use distroless/base-debian12:nonroot. scratch works for static binaries but needs CA certs and tzdata copied in.Build with cargo build --release (cache /usr/local/cargo/registry and target; cargo-chef for dependency-layer caching), copy the binary to gcr.io/distroless/cc-debian12:nonroot.
**/.git
**/bin/
**/obj/
**/node_modules
**/.venv
**/__pycache__
**/target/
**/build/
**/.vs/
**/.idea/
**/*.user
**/.env*
Dockerfile*
## Detected
<stack, version, entry point, package manager>
## Dockerfile
<multi-stage, commented where non-obvious>
## .dockerignore
## Build & run
docker build -t <app>:<tag> .
docker run -p 8080:8080 <app>:<tag>
## Notes
<base image choice, size/security trade-offs, anything to verify>
"Dockerize this .NET app", "give me a multi-stage Dockerfile for my NestJS API", "containerize this FastAPI service with uv", "shrink my Spring Boot image", "distroless image for my Go service", "make my container run as non-root". Pairs with cicd-pipeline-generator, dependency-vuln-scanner (scan the image), and microservice-template-generator.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
45 skills in this plugin
/api-endpoint-scaffolderScaffold HTTP API endpoints in any stack - ASP.NET Core Minimal APIs or controllers, Express, Fastify, NestJS, FastAPI, Django REST Framework, Spring Boot controllers, Go net/http, chi, Gin - one feature per endpoint (REPR style) with request validation, typed responses, route grouping, auth, and OpenAPI metadata. Use this skill whenever the user wants to add an endpoint or route, convert controllers to minimal APIs, structure routes or routers, set up endpoint groups, TypedResults, route handlers, request DTOs/schemas (zod, Pydantic, Bean Validation, binding tags), or asks "how do I add an endpoint / structure my API routes". Always use this skill for endpoint scaffolding; it generates a complete, validated endpoint that matches the project's conventions./architecture-test-generatorGenerate architecture tests / fitness functions that fail the build when architectural rules are violated - layer dependencies, module boundaries, cycles, naming, and visibility conventions - in any stack: NetArchTest or ArchUnitNET (.NET), ArchUnit or Konsist (Java/Kotlin), dependency-cruiser or eslint-plugin-boundaries (TypeScript/JavaScript), import-linter (Python), go-arch-lint or depguard (Go). Use this skill whenever the user wants architecture tests, to enforce layering or the dependency rule, dependency rules as tests, import rules, forbidden imports, no circular dependencies, naming conventions, fitness functions, or asks "how do I stop people breaking the architecture / enforce my layers / keep modules from importing each other". Always use this skill for architecture-test requests; it generates rules matching the project's real structure./ai-dev-toolkit:dockerfile-generatorfrom AI for Developers Toolkit
npx claudepluginhub stefanthecode/ai-for-developers --plugin ai-dev-toolkitOther plugins' skills for the same job