dockerfile-best-practices
Dockerfile best practices, layer optimization, multi-stage builds, security, and image size reduction.
от sethdford★ 51 звезда на GitHub
Установить dockerfile-best-practices в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Dockerfile Best Practices
Writing efficient, secure container images.
Context
You are writing a Dockerfile. Optimize for size, build speed, and security.
Domain Context
- Layers: Each line creates a layer; fat layers are slow to build/push
- Caching: Earlier layers cache better; put changeable stuff at end
- Multi-Stage: Separate build and runtime images; smaller final image
- Security: Don't run as root; minimal base image
- Size: Alpine < Ubuntu < Debian; watch for bloat
Instructions
- Choose Base Image: Alpine (small), Debian (compatible), Ubuntu (big)
- Install Essentials: Only what's needed; remove package caches
- Use Multi-Stage: Build stage, runtime stage; small final image
- Order Statements: Stable first, changeable last (maximize caching)
- Run as Non-Root: Create user, switch with USER
- Health Checks: HEALTHCHECK for container orchestrators
- Documentation: Comments explain why, not what
Anti-Patterns
- Fat images (>500MB); slow to push/deploy
- Running as root; security risk
- Single huge layer; no caching benefit
- Installing dev tools in production; unnecessary bloat
- Many layers; each adds overhead
Further Reading
- Docker documentation best practices
- Google Cloud dockerfile best practices
- Container security guidelines
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл dockerfile-best-practices?
Dockerfile best practices, layer optimization, multi-stage builds, security, and image size reduction.
Как установить скилл dockerfile-best-practices?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл dockerfile-best-practices запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
AnthropicThe scan that the plugin's GitHub Action runs.
azure-static-web-apps
GitHubHelps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
ai-ready
GitHubMake any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
aws-cdk-python-setup
GitHubSetup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…