AgentStack
SKILL verified MIT Self-run

Dockerfile

skill-pulkit0x-claude-armory-dockerfile-generator · by pulkit0x

Generate an optimized, production-ready Dockerfile for the current project. Use when: user says 'create dockerfile', 'generate docker', 'dockerize this', 'write a dockerfile', or '/dockerfile'.

No reviews yet
0 installs
15 views
0.0% view→install

Install

$ agentstack add skill-pulkit0x-claude-armory-dockerfile-generator

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Dockerfile? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Dockerfile Generator

Analyze the current project and generate an optimized, production-ready, multi-stage Dockerfile.

Process

  1. Detect project stack by scanning for manifest files:
  • package.json / yarn.lock / pnpm-lock.yaml -> Node.js
  • pom.xml / build.gradle -> Java (Maven/Gradle)
  • requirements.txt / pyproject.toml / Pipfile -> Python
  • go.mod -> Go
  • Cargo.toml -> Rust
  • Gemfile -> Ruby
  • pubspec.yaml -> Dart/Flutter
  • *.csproj / *.sln -> .NET
  1. Detect framework from dependencies:
  • Express, Next.js, Nest.js, Fastify (Node)
  • Spring Boot, Quarkus (Java)
  • Django, Flask, FastAPI (Python)
  • Gin, Echo, Fiber (Go)
  1. Read project config for:
  • Entry point / main file
  • Build commands
  • Port numbers
  • Environment variable requirements
  1. Generate Dockerfile following best practices.
  1. Generate .dockerignore if it doesn't exist.

Best Practices to Follow

Always

  • Use multi-stage builds (builder + runtime)
  • Use specific version tags for base images (not latest)
  • Use slim/alpine base images for runtime
  • Run as non-root user in production stage
  • Set WORKDIR explicitly
  • Copy dependency files first, install, then copy source (layer caching)
  • Use COPY not ADD (unless extracting archives)
  • Set ENV NODE_ENV=production or equivalent
  • Include HEALTHCHECK instruction
  • Use .dockerignore to exclude unnecessary files

Never

  • Install dev dependencies in the runtime image
  • Leave package manager caches in the final image
  • Use root user in the final stage
  • Hardcode secrets or credentials
  • Use latest tag for base images

Templates by Stack

Node.js

FROM node:-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM node:-alpine
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
COPY package*.json ./
USER appuser
EXPOSE 
HEALTHCHECK CMD wget -q --spider http://localhost:/health || exit 1
CMD ["node", "dist/index.js"]

Java (Spring Boot)

FROM eclipse-temurin:-jdk-alpine AS builder
WORKDIR /app
COPY pom.xml mvnw ./
COPY .mvn .mvn
RUN ./mvnw dependency:resolve
COPY src ./src
RUN ./mvnw package -DskipTests

FROM eclipse-temurin:-jre-alpine
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
WORKDIR /app
COPY --from=builder /app/target/*.jar app.jar
USER appuser
EXPOSE 
HEALTHCHECK CMD wget -q --spider http://localhost:/actuator/health || exit 1
ENTRYPOINT ["java", "-jar", "app.jar"]

Python

FROM python:-slim AS builder
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt

FROM python:-slim
RUN useradd -m -r appuser
WORKDIR /app
COPY --from=builder /install /usr/local
COPY . .
USER appuser
EXPOSE 
HEALTHCHECK CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:/health')" || exit 1
CMD ["python", "app.py"]

Go

FROM golang:-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o server .

FROM alpine:3.19
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
WORKDIR /app
COPY --from=builder /app/server .
USER appuser
EXPOSE 
HEALTHCHECK CMD wget -q --spider http://localhost:/health || exit 1
CMD ["./server"]

Output

  1. Write the Dockerfile to the project root.
  2. Write .dockerignore if it doesn't exist.
  3. Print a summary: detected stack, base image chosen, exposed port, and build/run commands:

`` docker build -t . docker run -p : ``

Notes

  • If $ARGUMENTS contains a framework hint (e.g., "nextjs", "spring"), use that to guide detection.
  • If multiple stacks detected (monorepo), ask the user which service to dockerize.
  • Always read the existing Dockerfile first if one exists — offer to improve it rather than overwrite.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.