Skip to content
Development
Skill

/dockerfile

Generate an optimized Dockerfile — multi-stage build, security hardening, small image size.

From plugin
agentic-awesome-kits
932 skills
Install
$ npx -y skills add KhaiTrang1995/agentic-awesome-kits --skill dockerfile --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/dockerfile

Context preview

The summary Claude sees to decide when to auto-load this skill.

Generate an optimized Dockerfile — multi-stage build, security hardening, small image size.

SKILL.md

dockerfile.SKILL.md
name: dockerfile
description: Generate an optimized Dockerfile — multi-stage build, security hardening, small image size.
user-invocable: true
argument-hint: "<stack> [--prod] [--dev]"

/dockerfile — Generate a Dockerfile

Input examples

/dockerfile .NET 10 Minimal API --prod
/dockerfile Angular 20 nginx --prod
/dockerfile Python FastAPI
/dockerfile Go service --prod
/dockerfile --dev fullstack .NET + Angular (docker-compose dev)

Process

1. Detect the stack → pick the right base image 2. Multi-stage build: build stage → runtime stage 3. Security hardening 4. L1 approval → Write

Mandatory rules

  • **Multi-stage build** — separate build and runtime
  • **Non-root user** — NEVER run the container as root
  • **Specific tag** — `mcr.microsoft.com/dotnet/aspnet:10.0-alpine`, NEVER `latest`
  • **COPY before RUN** — leverage layer caching (copy csproj/package.json first, restore, then copy source)
  • **.dockerignore** — exclude bin/, obj/, node_modules/, .git/
  • **HEALTHCHECK** — mandatory for production
  • **NEVER hardcode** secrets/connection strings — use env vars
  • **Alpine-based** whenever possible (small image size)

Output

Dockerfile
.dockerignore

References

  • @.claude/rules/docker-conventions.md
Ships withagentic-awesome-kits

Reusable AI Skill Kits for coding agents (Claude Code and any other subagent/slash-command-compatible tool).

Get the whole plugin
Stats
9
Stars
4
Forks
Maintained
Maintenance
Python
Language
1mo ago
Last commit
2mo ago
Created

Repo: KhaiTrang1995/agentic-awesome-kits

Other skills on agentic-awesome-kits.