
Docker Optimization
Shrink Docker images, speed up builds, and tune container runtime limits before you ship services to production.
Overview
docker-optimization is an agent skill most often used in Ship (also Build backend, Operate infra) that guides Docker image size, build speed, and runtime tuning for solo-builder deploys.
Install
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-docker --skill docker-optimizationWhat is this skill?
- Image size playbook: alpine/slim bases, multi-stage builds, cache cleanup, combined RUN layers, and .dockerignore
- Build speed: layer ordering by change frequency, BuildKit cache, parallel builds, and build-arg discipline
- Runtime performance: memory limits, CPU shares, tmpfs for temp I/O, health checks, and restart policies
- Markdown-oriented output format with optional strict validation in production environments
- Integrations toggles for git, linter, and formatter in generated plugin-style config
- Three optimization pillars: image_size, build_speed, runtime_performance
- Environment profiles: development and production with distinct log_level and strict_mode validation
Adoption & trust: 1 installs on skills.sh; 2 GitHub stars; 3/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
What problem does it solve?
Your Docker images are huge, CI builds rerun from scratch every push, and production containers have no sane memory limits or health checks.
Who is it for?
Solo devs shipping containerized APIs or workers who want fast, repeatable image builds without hiring a platform team.
Skip if: Bare-metal deploys with no Docker, or teams needing full SOC2 container compliance narratives in one skill.
When should I use this skill?
User asks to optimize Docker images, speed up container builds, or improve runtime performance of Dockerized services.
What do I get? / Deliverables
You get a structured optimization checklist and config defaults—multi-stage patterns, BuildKit habits, and runtime policies—ready to paste into Dockerfiles and compose files.
- Markdown optimization report with categorized recommendations
- Optional docker-optimization YAML-style configuration for plugin workflows
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Ship/Launch is the canonical shelf because Dockerfile and compose choices directly affect release artifacts, deploy time, and first production footprint—even though optimization starts during Build. Launch subphase covers container images as the handoff artifact to hosting (Fly, ECS, k8s, Railway) where size and health checks matter at go-live.
Where it fits
Refactor a monolithic Dockerfile into multi-stage before adding Postgres sidecars.
Cut registry pull time minutes before a product launch on a small VPS.
Add memory limits and restart policies after OOM kills in production.
How it compares
Structured optimization checklist for Dockerfiles and runtime flags—not a substitute for full Kubernetes or cloud-specific landing-zone skills.
Common Questions / FAQ
Who is docker-optimization for?
Solo and indie builders containerizing SaaS, APIs, or CLIs who want their agent to apply proven Docker size and CI cache patterns instead of one-off chat advice.
When should I use docker-optimization?
While Build backend work defines the first Dockerfile, during Ship launch prep before registry push, and in Operate infra when tuning memory and health checks after traffic grows.
Is docker-optimization safe to install?
It recommends standard Docker practices; confirm changes in staging and read the Security Audits panel on this Prism page before enabling auto-fix style options in production.
SKILL.md
READMESKILL.md - Docker Optimization
# docker-optimization Configuration # Category: containers # Generated: 2025-12-30 skill: name: docker-optimization version: "1.0.0" category: containers settings: # Default settings for docker-optimization enabled: true log_level: info # Category-specific defaults validation: strict_mode: false auto_fix: false output: format: markdown include_examples: true # Environment-specific overrides environments: development: log_level: debug validation: strict_mode: false production: log_level: warn validation: strict_mode: true # Integration settings integrations: # Enable/disable integrations git: true linter: true formatter: true # Docker Optimization Guide image_size: - Use alpine/slim base images - Multi-stage builds - Remove package caches - Combine RUN commands - Use .dockerignore build_speed: - Order Dockerfile by change frequency - Use BuildKit cache - Parallelize builds - Use build arguments wisely runtime_performance: - Set memory limits - Configure CPU shares - Use tmpfs for temp files - Optimize health checks - Use restart policies { "$schema": "http://json-schema.org/draft-07/schema#", "title": "docker-optimization Configuration Schema", "type": "object", "properties": { "skill": { "type": "object", "properties": { "name": { "type": "string" }, "version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" }, "category": { "type": "string", "enum": [ "api", "testing", "devops", "security", "database", "frontend", "algorithms", "machine-learning", "cloud", "containers", "general" ] } }, "required": [ "name", "version" ] }, "settings": { "type": "object", "properties": { "enabled": { "type": "boolean", "default": true }, "log_level": { "type": "string", "enum": [ "debug", "info", "warn", "error" ] } } } }, "required": [ "skill" ] } # Docker Optimization Guide ## Overview This guide provides comprehensive documentation for the **docker-optimization** skill in the custom-plugin-docker plugin. ## Category: Containers ## Quick Start ### Prerequisites - Familiarity with containers concepts - Development environment set up - Plugin installed and configured ### Basic Usage ```bash # Invoke the skill claude "docker-optimization - [your task description]" # Example claude "docker-optimization - analyze the current implementation" ``` ## Core Concepts ### Key Principles 1. **Consistency** - Follow established patterns 2. **Clarity** - Write readable, maintainable code 3. **Quality** - Validate before deployment ### Best Practices - Always validate input data - Handle edge cases explicitly - Document your decisions - Write tests for critical paths ## Common Tasks ### Task 1: Basic Implementation ```python # Example implementation pattern def implement_docker_optimization(input_data): """ Implement docker-optimization functionality. Args: input_data: Input to process Returns: Processed result """ # Validate input if not input_data: raise ValueError("Input required") # Process result = process(input_data) # Return return result ``` ### Task 2: Advanced Usage For advanced scenarios, consider: - Configuration customization via `assets/config.yaml` - Validation using `scripts/validate.py` - Integration with other skills ## Troubleshooting ### Common Issues | Issue | Cause | Solution | |-------|-------|----------| | Skill not found | Not installed | Run plugin sync | | Va