What problem does it solve? Docker images often ship bloated with build tools, caches, and secrets, resulting in slow builds, large deployments, and security risks. This Skill provides proven patterns to reduce image sizes by 70-90% and build times by 50-80% while hardening containers for production. ## Core Features & Use Cases - Multi-Stage Build Patterns: Separate build and runtime stages to strip compilers, package caches, and dev dependencies from final images. - Layer Caching & BuildKit: Order Dockerfile instructions by change frequency, use .dockerignore, and leverage BuildKit cache mounts for faster rebuilds. - Security Hardening: Run as non-root users, pin exact image versions, exclude secrets, and scan images with Trivy or Docker Scout. - Use Case: A Python FastAPI app with a 1.2GB image and 5-minute builds is restructured into a 140MB multi-stage image with 2-minute builds, non-root execution, and preserved dependency caching. ## Quick Start Ask the agent to optimize your Dockerfile for size, build speed, and security using the docker optimization patterns.