docker-squash
Docker layer squashing tool
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- 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.
- 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 · maintenance · safety
MIT (permissive) — MIT license is permissive and imposes no restrictions on use, modification, or distribution.
last release 2024-11-13 (639 days) · last repo commit 2025-07-04 · 958 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 113,839 downloads/mo, #12,328 on PyPI
Alternatives
Verify before relying
pip install docker-squash
docker-squash -f <layer-id-or-count> -t <new-tag> <image-name>- 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
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 on this page. Verify before relying on it.
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
docker-squash on PyPI
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).
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.
License in practice
MIT license is permissive and imposes no restrictions on use, modification, or distribution.
Quickstart
pip install docker-squash
docker-squash -f <layer-id-or-count> -t <new-tag> <image-name>
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 | Not specified |
| Install friction | High. Source build required |
| Runtime dependencies | 2 packagesdockerpackaging |
| Maintenance | Aging 639 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 113,839 / month, #12,328 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: docker_squash-1.2.2.tar.gz
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “docker layer squashing”
- docker-squashCombines multiple Docker image layers into fewer layers to reduce…
- container-inspectorAnalyzes Docker images, containers, and virtual machine images to…
- exasol-integration-test-docker-environmentProvides a CLI and Python API to start and manage Exasol Docker-DB…
Give your agent the search over MCP, or paste the wish link into any chat.
More Build Tools packages
Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.
Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.
Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.
pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.
Install it if your team needs consistent, automated validation at commit time.
See also container-inspector · nvidia-modelopt · tf-slim · psd-tools · azure-containerregistry · lib-layered-config · blend-modes · model-compression-toolkit · binpacking · tox-docker