Container Image Size Optimizer Advice Tool
Analyze a Dockerfile and suggest changes to improve caching and reduce image size.
Last reviewed by the Radiatus Cloud team
Output
Want this automated for your stack?
We build CI/CD, Kubernetes & IaC pipelines that scale.
Make your builds faster and your images smaller
How a Dockerfile is written decides how fast it builds and how large the resulting image is, and small changes make large differences. This tool analyses a Dockerfile and suggests changes to improve layer caching and reduce image size, so your builds are quicker and your images leaner.
The two levers: caching and layers
Build speed comes mostly from the cache. Docker caches each layer and reuses it until something changes, so ordering instructions to put stable steps first, dependency installation before copying source, means a code change does not re-run the whole build. Image size comes from what ends up in the layers: combining commands, cleaning up in the same layer that created the mess, and using slim base images all trim the result. The advice targets both.
Concrete suggestions to apply
Rather than general principles, the tool points at the specific lines in your Dockerfile where reordering or combining would help, which is the difference between knowing the theory and improving your actual build.
Related tools
- CI/CD Security Gap Analyzer — Checklist based analyzer for CI/CD pipeline security gaps.
- Docker Security Scanner — A new tool extracted from the codebase.
- Terraform Scanner — A new tool extracted from the codebase.
- SQL Formatter — Format and indent SQL queries for readability. Handles joins, subqueries and CTEs, supports common dialects, and runs entirely in your browser.
Frequently Asked Questions
How does instruction order affect build speed?
Docker caches layers in order and reuses them until something changes. Putting stable steps first, like installing dependencies before copying source, means a code change does not invalidate the whole build.
What makes an image smaller?
Combining commands so fewer layers are created, cleaning up in the same layer that created the files, and using slim base images. Leftover files in a layer persist even if a later layer removes them.
Why copy dependencies before source code?
So that changing your source does not invalidate the cached dependency-installation layer, which is usually the slowest step. Only the copy and later steps re-run.
Does it change my Dockerfile automatically?
No. It suggests specific changes for you to review and apply, pointing at the lines where reordering or combining would help.
Is my Dockerfile uploaded?
No. The analysis runs entirely in your browser.
Privacy & Security
Processed locally in your browser. No data is sent to any server.
How to Use
Paste a Dockerfile to get optimization suggestions.
Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.