Skill Detail

Docker Image Layer Inspector

Analyzes Docker image layers using the Docker Registry HTTP API v2 and Dive CLI. Identifies wasted space, duplicate files, and optimizes Dockerfile instructions for smaller builds.

CI/CD IntegrationsCustom Agents

Analyzes Docker image layers using the Docker Registry HTTP API v2 and Dive CLI. Identifies wasted space, duplicate files, and optimizes Dockerfile instructions for smaller builds.

CI/CD Integrations Custom Agents Security Reviewed
INSTALL WITH ANY AGENT
npx skills add agentskillexchange/skills --skill docker-image-layer-inspector Copy

The Docker Image Layer Inspector skill connects to container registries via the Docker Registry HTTP API v2 to fetch image manifests (GET /v2/{name}/manifests/{reference}) and layer blobs. It decompresses each layer tarball to analyze file additions, modifications, and deletions across the build history. Integration with the Dive analysis engine provides efficiency scores by calculating the ratio of wasted bytes to total image size. The skill identifies common optimization opportunities including: package manager cache files left in layers, duplicate copies of shared libraries, unnecessary build tools in runtime images, and oversized base image selections. It queries Docker Hub API (GET /v2/repositories/{namespace}/{repo}/tags) to compare image sizes across tags and suggest lighter base alternatives. Multi-stage build recommendations are generated by analyzing which files from build stages are actually needed in the final image. Output includes an optimized Dockerfile with specific instruction reordering and layer consolidation suggestions.