check-docker-layer-efficiency
Installation
SKILL.md
Docker Layer Efficiency Checker
Analyze Dockerfile layer structure for optimal ordering, cache utilization, and build performance.
Optimal Layer Ordering
| Order | Layer Type | Change Frequency | Example |
|---|---|---|---|
| 1 | Base image | Rare | FROM php:8.4-fpm |
| 2 | System deps | Rare | RUN apt-get install |
| 3 | PHP extensions | Rare | RUN docker-php-ext-install |
| 4 | Composer deps | Weekly | COPY composer.* && composer install |
| 5 | NPM deps | Weekly | COPY package.* && npm ci |
| 6 | Config files | Occasional | COPY php.ini, nginx.conf |
| 7 | App source | Every commit | COPY . /var/www/html |
| 8 | Build steps | Every commit | RUN composer dump-autoload |