--- id: docker-squash version: "1.2.2" license: MIT license_treatment: permissive maintenance: aging --- # docker-squash — Docker layer squashing tool License: permissive · Maintenance: aging · Downloads: 113.8K/mo ## What it is and what it does docker-squash is a command-line tool that merges multiple layers in a Docker image into fewer layers. Docker builds create many intermediate layers, some of which may contain temporary files that are deleted in later layers—these unnecessary layers bloat the final image. The tool lets you squash the last N layers, or all layers from a specified layer onward, reducing image size and improving push/load performance. The tool works by extracting the image, combining the target layers into a single tar archive, and either loading the result back into the Docker daemon or saving it as a tar file. It depends on the docker and packaging libraries and runs as a CLI utility rather than as an importable module. Use it for: - Reduce final image size after a multi-stage build by squashing temporary build artifacts into a single layer. - Optimize images for faster push to a registry by consolidating many small metadata layers. - Simplify image history for cleaner layer inspection and easier debugging of production images. - Prepare images for distribution where layer count matters (e.g., embedded or resource-constrained environments). - Consolidate base image layers with application layers to reduce the number of independent components. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Combines multiple Docker image layers into fewer layers to reduce image size and push/load time, controllable by layer count or starting layer ID. Yes, if you actively manage Docker images and want to reduce their size and push time. The tool is straightforward and has no known vulnerabilities. However, the aging maintenance status (last release 639 days ago) and high install friction (source distribution, Docker daemon requirement) mean you should verify compatibility with your Docker version before relying on it in production workflows. For one-off optimization tasks, it's low risk; for frequent automation, consider whether a more actively maintained alternative exists. ## Install pip install docker-squash uv add docker-squash poetry add docker-squash ## Installing docker-squash Before you install: High install friction due to a source distribution and direct Docker daemon dependency. Maintenance status is aging—last release was 639 days ago, though the repository remains active with recent commits and moderate GitHub stars (958). License in practice: MIT license is permissive and imposes no restrictions on use, modification, or distribution. Quickstart: pip install docker-squash docker-squash -f -t Requires a running Docker daemon and Docker CLI to be installed on the system; the package itself is a CLI tool, not a library for programmatic use. Verify before relying: - Whether the package works reliably with current Docker versions beyond 1.9 - Whether Python version support has changed since the description mentions 3.6+ - Whether the tool handles modern image formats (e.g., OCI) or only Docker v1/v2 formats ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: high - Maintenance: aging - Downloads: 113.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags docker layer squashing, reduce docker image size, combine docker layers, docker image optimization, docker layer consolidation, minimize docker image, docker build optimization, docker-optimization, cli-tool, image-management [View on SkillFed](https://skillfed.io/packages/docker-squash) · [View on PyPI](https://pypi.org/project/docker-squash/)