docker-development

Optimize Dockerfiles for size, speed, and security.

Updated Apr 2, 2026
One-click install
npx skills add https://github.com/4lerman/text_evaluator --skill docker-development-4lerman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker-development
Source: https://github.com/4lerman/text_evaluator/tree/main/.agents/skills/engineering-advanced-skills/docker-development
Command: npx skills add https://github.com/4lerman/text_evaluator --skill docker-development-4lerman

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires scripts/dockerfile_analyzer.py, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides advanced tools and best practices for Dockerfile optimization, container security hardening, and efficient Docker workflows, making container development more efficient and secure.

Core Features & Use Cases

  • Dockerfile Optimization: Analyze and optimize Dockerfiles for size, speed, and layer caching.
  • Security Audit: Audit Dockerfiles and running containers for security issues like running as root, using the latest tag, and retaining package manager caches.
  • Docker Compose Configuration: Generate or improve docker-compose.yml files with best practices for services, networking, and environment configuration.
  • Multi-Stage Build Patterns: Implement efficient multi-stage builds for compiled languages and runtime optimizations.
  • Base Image Decision Tree: Guidance on choosing the appropriate base image for different scenarios.
  • Proactive Triggers: Flags and suggestions for common issues and best practices.
  • Related Skills: Integration with other skills for broader DevOps and security workflows.

Quick Start

Run the optimization command for your Dockerfile with the following:

/docker:optimize

Frequently Asked Questions about docker-development

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

FAQPage Schema
How do I optimize a Dockerfile for size, speed, and security?

To optimize a Dockerfile for size, speed, and security, you can use static analysis to audit layer caching, enforce multi-stage build patterns, and eliminate running as root or retaining package caches.

What are the best practices for Docker container security hardening?

Docker container security hardening involves auditing configurations to prevent running containers as root, avoiding the latest tag, and clearing package manager caches to minimize attack surfaces.

How do I configure Docker Compose for production environments?

Configuring Docker Compose for production requires applying best practices for service definitions, networking, and environment variable management to streamline orchestration and enhance security.

When should I use multi-stage builds in a Dockerfile?

Multi-stage builds are needed when optimizing compiled languages, allowing you to separate the build environment from the runtime environment to significantly reduce final container image size.

How do I choose the right base image for my Docker container?

Choosing the right base image requires evaluating a decision tree based on your specific scenario, balancing runtime requirements, image size, and built-in security features for production-grade containers.

Do I need a static analysis script to audit my Dockerfiles?

Yes, Dockerfile static analysis requires a dedicated analyzer script to proactively flag common issues like improper layer caching, root execution, and outdated base tags for build optimization.