A CLI tool to enforce size and layer limits on Docker images, ideal for CI/CD pipelines.
docker-image-size-limit is a Python-based CLI tool that enforces size and layer limits on Docker images. It helps developers prevent Docker images from becoming too large, which can impact deployment speed and storage efficiency. The tool is designed to be integrated into CI/CD pipelines to catch oversized images early in the development process.
DevOps engineers, CI/CD pipeline maintainers, and developers who build and deploy Docker images and want to enforce size constraints automatically.
It provides a simple, reusable alternative to custom bash scripts for image size checking, with support for multiple input formats, layer limits, and easy integration via GitHub Actions or Docker.
:whale: Keep an eye on your docker image size and prevent it from growing too big
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Accepts limits in bytes, MB, MiB, GB, GiB, or any format supported by the humanfriendly library, as shown in the Options section, making it easy to specify constraints in familiar units.
Offers multiple integration methods including a GitHub Action, pre-built Docker image, and standalone CLI, allowing it to fit into various pipeline setups without custom scripting.
Provides a Python API with type annotations for programmatic checks, enabling developers to embed size validation directly into their codebase, as detailed in the Programmatic usage section.
Supports enforcing a maximum number of layers with the --max-layers flag, promoting efficient Dockerfile practices to reduce image bloat and improve performance.
Requires mounting /var/run/docker.sock when using the Docker image, which can expose the host Docker daemon and pose a security risk in shared or production environments.
Only reports size and layer violations without suggesting how to reduce image size or optimize layers, limiting its utility for teams seeking to improve Dockerfile design.
Relies on Python installation, which may add unnecessary complexity in environments where Python isn't already available or where lightweight, native tools are preferred.