dockerfile-generator
БесплатноЗапускает вложенные скриптыНе проверенCreate, generate, or write Dockerfiles and multi-stage Docker images. Containerize apps.
от akin-ozer★ 346 звёзд на GitHubОб этом скилле
Dockerfile Generator
Overview
This skill provides a comprehensive workflow for generating production-ready Dockerfiles with security, optimization, and best practices built-in. Generates multi-stage builds, security-hardened configurations, and optimized layer structures with automatic validation and iterative error fixing.
Key Features:
- Multi-stage builds for optimal image size (50-85% reduction)
- Security hardening (non-root users, minimal base images, no secrets)
- Layer caching optimization for faster builds
- Language-specific templates (Node.js, Python, Go, Java)
- Automatic .dockerignore generation
- Integration with
dockerfile-validatorfor validation - Iterative validation and error fixing (minimum 1 iteration if errors found)
- Local references plus docs lookup fallback chain for framework-specific patterns
When to Use This Skill
Invoke this skill when:
- Creating new Dockerfiles from scratch
- Containerizing applications (Node.js, Python, Go, Java, or other languages)
- Implementing multi-stage builds for size optimization
- Converting existing Dockerfiles to best practices
- Generating production-ready container configurations
- Optimizing Docker builds for security and performance
- The user asks to "create", "generate", "build", or "write" a Dockerfile
- Implementing containerization for microservices
- Setting up CI/CD pipeline container builds
Trigger Phrases
Use this skill immediately when the request contains phrasing like:
- "Generate a production Dockerfile for my app"
- "Create a multi-stage Dockerfile for <language/framework>"
- "Containerize this service with security best practices"
- "Optimize this Dockerfile for size and build speed"
- "Write Dockerfile and .dockerignore for deployment"
Do NOT Use This Skill For
- Validating existing Dockerfiles (use
dockerfile-validatorinstead) - Building or running containers (use docker build/run commands)
- Debugging running containers (use docker logs, docker exec)
- Managing Docker images or registries
Deterministic Execution Model
Run these stages in order, and do not skip a stage unless the skip reason is reported in the final output.
- Gather requirements (language, runtime version, entrypoint, exposed port, package manager, health endpoint).
- Load references (local reference files first; external docs only when local references are insufficient).
- Generate Dockerfile and
.dockerignore. - Validate with
dockerfile-validatoror fallback local tools. - Iterate fixes until stop condition is met.
- Publish final artifacts plus validation/audit report.
Stop conditions for stage 5:
- Stop when there are zero validation errors and no unapproved warnings.
- Stop after 3 iterations maximum, then emit an intentional-deviation report for unresolved findings.
Reference Path Map
Consult these files directly by path as needed:
references/security_best_practices.mdfor non-root users, secret handling, base image hardening, vulnerability scanning.references/optimization_patterns.mdfor multi-stage strategy, cache optimization, layer reduction, BuildKit cache mounts.references/language_specific_guides.mdfor language/framework runtime and package-manager patterns.references/multistage_builds.mdfor advanced stage-splitting and artifact-copy patterns.
Dockerfile Generation Workflow
Follow this workflow when generating Dockerfiles. Adapt based on user needs:
Stage 1: Gather Requirements
Objective: Understand what needs to be containerized and gather all necessary information.
Information to Collect:
Application Details:
- Programming language and version (Node.js 18/20, Python 3.11/3.12, Go 1.21+, Java 17/21, etc.)
- Application type (web server, API, CLI tool, batch job, etc.)
- Framework (Express, FastAPI, Spring Boot, etc.)
- Entry point (main file, command to run)
Dependencies:
- Package manager (npm/yarn/pnpm, pip/poetry, go mod, maven/gradle)
- System dependencies (build tools, libraries, etc.)
- Build-time vs runtime dependencies
Application Configuration:
- Port(s) to expose
- Environment variables needed
- Configuration files
- Health check endpoint (for web services)
- Volume mounts (if any)
Build Requirements:
- Build commands
- Test commands (optional)
- Compilation needs (for compiled languages)
- Static asset generation
Production Requirements:
- Expected image size constraints
- Security requirements
- Scaling needs
- Resource constraints (CPU, memory)
Use AskUserQuestion if information is missing or unclear.
Example Questions:
- What programming language and version is your application using?
- What is the main entry point to run your application?
- Does your application expose any ports? If so, which ones?
- Do you need any system dependencies beyond the base language runtime?
- Does your application need a health check endpoint?
Установить dockerfile-generator в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл dockerfile-generator?
Create, generate, or write Dockerfiles and multi-stage Docker images. Containerize apps.
Как установить скилл dockerfile-generator?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл dockerfile-generator запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic