Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

dot-ai-generate-dockerfile

БесплатноБез исполняемых скриптовНе проверен

Generate production-ready, secure, multi-stage Dockerfile and .dockerignore for any project

vfarcicот vfarcic★ 340 звёзд на GitHub

Об этом скилле

Generate Production-Ready Dockerfile

Generate an optimized, secure, multi-stage Dockerfile and .dockerignore for the current project by analyzing its structure, language, framework, and dependencies.

Instructions

You are helping a developer containerize their application for production deployment. Your task is to analyze the project structure and generate two files:

  1. Dockerfile: Production-ready, multi-stage build with security best practices
  2. .dockerignore: Optimized build context configuration

Critical Principles

These are non-negotiable rules that override all other guidance.

Verify Everything Before Adding It

ABSOLUTE RULE: Before adding ANY instruction, configuration, or feature to the Dockerfile, verify it by examining the actual codebase.

Required Process:

  1. Identify what you think should be added
  2. Search the codebase to verify it exists or is actually needed
  3. Only add if verified - if you can't find evidence in the code, don't add it
  4. When uncertain, ask the user - if you cannot deduce something from the codebase analysis, ask the user rather than guessing

Never assume. Always verify. Ask when uncertain. Evidence-based Dockerfiles only.

Thoroughness over speed: Shallow analysis leads to broken Dockerfiles. Before generating anything:

  • Read the actual source files, not just file names or directory listings
  • Search for patterns multiple times with different queries if needed
  • Trace the application entry point through its imports and dependencies
  • Don't stop at the first search result - investigate thoroughly
  • If analysis feels quick, you probably missed something

A correct Dockerfile that took longer to generate is far better than a fast but broken one. Spend the time upfront.

Multi-Architecture Support

REQUIREMENT: Ensure all Dockerfile instructions support multiple architectures (amd64, arm64, etc.).

Apply to:

  • Base image selection: Use multi-arch official images
  • Binary downloads: Detect architecture dynamically, never hardcode (amd64, x86_64, etc.)
  • System package installation: Use package manager (automatically handles architecture)
  • Build commands: Ensure cross-platform compatibility

The Dockerfile must build successfully on different CPU architectures without modification.

NEVER Add HEALTHCHECK

ABSOLUTE PROHIBITION: DO NOT add HEALTHCHECK instruction under ANY circumstances.

Why:

  • Health endpoints are application-specific and cannot be verified from codebase analysis
  • Adding unverified health checks will cause containers to be marked unhealthy incorrectly
  • Users will add their own HEALTHCHECK if their application has health endpoints

If you add HEALTHCHECK, you are violating the "verify everything" principle.


Best Practices Reference

These are best practices to consider when generating the Dockerfile. Apply them when relevant to the project - not every practice applies to every situation:

  • Package manager flags depend on which package manager is used (apt-get vs apk vs others)
  • Language-specific guidance applies only to that language
  • The "verify everything" principle overrides all: if a practice doesn't fit the project, skip it

Use this section as guidance during generation and a reference for validation.

Security

Practice Description
Non-root user Create and run as a dedicated user (UID 10001+), never run as root
Pin image versions Use specific tags like node:20-alpine, never :latest
Official images Prefer Docker Official Images or Verified Publishers from trusted sources
No secrets in image Never embed credentials, API keys, or passwords in Dockerfile or ENV instructions
No sudo Don't use sudo in containers; switch USER explicitly when root access is needed
Minimal packages Only install packages that are actually required for the application
--no-install-recommends Use this flag with apt-get to prevent installing optional packages
COPY over ADD Always use COPY unless you specifically need ADD's tar extraction; never use ADD with URLs
No debugging tools Avoid installing curl, wget, vim, netcat in production images unless required by the application
Clean in same layer Remove package manager caches in the same RUN command as installation
Executables owned by root Application binaries should be owned by root but executed by non-root user

Image Selection

Practice Description
Minimal base images Prefer alpine, slim, distroless, or scratch over full distribution images
Multi-stage builds Always separate build dependencies from runtime; build stage → runtime stage
Match language needs Compiled languages → distroless/scratch; Interpreted → slim/alpine with runtime
Derive version from project Get language version from project files
Полный SKILL.md на GitHub

Установить dot-ai-generate-dockerfile в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл dot-ai-generate-dockerfile?

Generate production-ready, secure, multi-stage Dockerfile and .dockerignore for any project

Как установить скилл dot-ai-generate-dockerfile?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл dot-ai-generate-dockerfile запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить dot-ai-generate-dockerfile с