docker-conventions

Standardize Dockerfile practices for security, performance, and maintainability.

Updated Feb 7, 2026
One-click install
npx skills add https://github.com/jsamuelsen11/claude-config --skill docker-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker-conventions
Source: https://github.com/jsamuelsen11/claude-config/tree/main/plugins/ccfg-docker/skills/docker-conventions
Command: npx skills add https://github.com/jsamuelsen11/claude-config --skill docker-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

## What problem does it solve? Dockerfiles often drift from best practices, leading to inconsistent builds, security risks, and maintainability issues across projects.

## Core Features & Use Cases

  • Enforce proper instruction ordering, layer caching, and multi-stage builds to optimize images.
  • Promote safe base image selection, minimal images, and secure runtime configuration for consistent deployments.
  • Use as a reference guide when auditing existing Dockerfiles or implementing new CI/CD pipelines to ensure reproducible builds.

Quick Start

Run a quick audit of your project’s Dockerfiles and apply the described conventions to improve build reliability and security.

Frequently Asked Questions about docker-conventions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize Dockerfile instruction ordering and layer caching for faster builds?

Enforce proper Dockerfile instruction ordering and multi-stage builds to optimize layer caching. This approach minimizes rebuild times by structuring instructions from least to most frequently changing layers, ensuring faster and more efficient container builds.

What is the safest way to select base images for minimal and secure Docker containers?

The safest approach to base image selection is choosing minimal images and configuring a secure runtime. This reduces the attack surface by including only essential dependencies, promoting safe runtime configurations and consistent deployments across your projects.

How do I audit existing Dockerfiles for security and maintainability issues?

Audit existing Dockerfiles by checking instruction ordering, COPY versus ADD usage, and CMD/ENTRYPOINT syntax. Use this standard reference to identify deviations from best practices, ensuring your images maintain security, performance, and long-term maintainability.

Does this Docker convention guidance apply to Python and Go application stacks?

Yes, these Docker conventions provide specific guidance for Node, Python, Go, and other stacks. The standardized practices cover stack-specific instruction ordering, metadata usage, and multi-stage build configurations to ensure consistent and safe deployments.

When should I use COPY instead of ADD in a Dockerfile?

Use COPY instead of ADD in Dockerfiles for simple file transfers to ensure transparency and predictable builds. ADD should be avoided unless you specifically need its automatic tar extraction or remote URL fetching capabilities, which can introduce security risks.

What are the limitations of using minimal base images for containerization?

Minimal base images reduce attack surface but may lack necessary system utilities or shared libraries required by your application. You must manually ensure all runtime dependencies are explicitly installed to prevent runtime execution failures in your secure containers.