Agent skill · software engineering · aiskillstore

docker-optimizer

Reviews Dockerfiles for best practices, security issues, and image size optimizations including multi-stage builds and layer caching. Use when working with Docker, containers, or deployment.

Why this skill is useful

Adds specific optimization patterns and security practices for Dockerfiles that the AI wouldn't reliably generate on its own.

What it needs

Requires docker installed locally. About 2k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

Docker Optimizer Analyzes and optimizes Dockerfiles for performance, security, and best practices. When to Use User working with Docker or containers Dockerfile optimization needed Container image too large User mentions "Docker", "container", "image size", or "deployment" Instructions 1. Find Dockerfiles Search for: Dockerfile, Dockerfile., .dockerfile 2. Check Best Practices Use specific base image versions: Minimize layers: Order instructions by change frequency: Use .dockerignore: 3. Multi-Stage Builds Reduce final image size: 4. Security Issues Don't run as root: No secrets in image: Scan for vulnerabilities: 5. Size Optimization Use Alpine images: node:18-alpine vs node:18 (900MB → 170MB) python:3.11-alpine vs python:3.11 (900MB → 50MB) Remove unnecessary files: Use specific COPY: 6. Caching Strategy Layer caching optimization: 7. Health Checks 8. Generate Optimized Dockerfile Provide improved version with: Multi-stage build Appropriate base image Security improvements Layer optimization Build caching .dockerignore file 9. Build Commands Efficient build: 10. Dockerfile Checklist [ ] Specific base image tag (not latest) [ ] Multi-stage build if applicable [ ] Non-root user [ ] Minimal layers (combined RUN commands) [ ] .dockerignore present [ ] No secrets in image [ ] Proper layer ordering for caching [ ] Alpine or slim variant used [ ] Cleanup in same RUN layer [ ] HEALTHCHECK defined Security Best Practices Scan images regularly Use official base images Keep base images updated Minimize attack surface (fewer packages) Run as non-root user Use read-only filesystem where possible Supporting Files templates/Dockerfile.optimized: Optimized multi-stage Dockerfile example templates/.dockerignore: Common .dockerignore patterns

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/docker-optimizer

View the source on GitHub

Browse the @skills marketplace