Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Docker
  3. Monitor and limit your docker image size

Monitor and limit your docker image size

MITPython2.2.0

A CLI tool to enforce size and layer limits on Docker images, ideal for CI/CD pipelines.

Visit WebsiteGitHubGitHub
133 stars5 forks0 contributors

What is Monitor and limit your docker image size?

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.

Target Audience

DevOps engineers, CI/CD pipeline maintainers, and developers who build and deploy Docker images and want to enforce size constraints automatically.

Value Proposition

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.

Overview

:whale: Keep an eye on your docker image size and prevent it from growing too big

Use Cases

Best For

  • Enforcing Docker image size limits in CI/CD pipelines
  • Validating layer counts to optimize Dockerfile structure
  • Integrating image size checks as a GitHub Action
  • Programmatically checking image sizes from Python code
  • Preventing oversized images from reaching production environments
  • Replacing custom bash scripts with a maintained tool

Not Ideal For

  • Teams needing detailed image optimization suggestions beyond size and layer counts
  • Projects with complex multi-stage builds where layer analysis might not account for intermediate layers
  • Environments where security policies restrict access to the Docker daemon socket for size checks
  • Use cases requiring historical tracking or trend analysis of image sizes over time

Pros & Cons

Pros

Flexible Size Formats

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.

Seamless CI/CD Integration

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.

Programmatic Python API

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.

Layer Count Enforcement

Supports enforcing a maximum number of layers with the --max-layers flag, promoting efficient Dockerfile practices to reduce image bloat and improve performance.

Cons

Security Risk with Docker Socket

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.

No Optimization Guidance

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.

Python Dependency Overhead

Relies on Python installation, which may add unnecessary complexity in environments where Python isn't already available or where lightweight, native tools are preferred.

Frequently Asked Questions

Quick Stats

Stars133
Forks5
Contributors0
Open Issues1
Last commit20 hours ago
CreatedSince 2019

Tags

#containerization#devops#image-optimization#ci#cli-tool#python3#python#ci-cd#code-quality#docker-images#docker#github-actions

Built With

P
Python
D
Docker

Links & Resources

Website

Included in

Docker35.8kGitHub Actions27.6k
Auto-fetched 18 hours ago

Related Projects

hadolinthadolint

Dockerfile linter, validate inline bash, written in Haskell

Stars12,319
Forks498
Last commit3 days ago
FROM:latestFROM:latest

An opinionated Dockerfile linter.

Stars1,033
Forks82
Last commit2 years ago
Update a Docker Hub repository description from README.mdUpdate a Docker Hub repository description from README.md

A GitHub action to update a Docker Hub repository description from README.md

Stars377
Forks52
Last commit23 days ago
Build And Push Your Docker Images Caching Each Stage To Reduce Build TimeBuild And Push Your Docker Images Caching Each Stage To Reduce Build Time

:octocat: Build and push docker images caching each stage to reduce build time

Stars351
Forks59
Last commit4 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub