Docker Image Size Calculator

Estimate Docker image size, compressed size, registry storage cost, and pull times by base image and added layers

A Docker image size calculator helps developers estimate container image size before running a build. Large images slow CI/CD pipelines, increase registry storage costs, and add latency to cold starts in Kubernetes and serverless environments. Pick a base image, add your layers, and get an instant size estimate with pull time and cost projections.

Estimated Size

Compressed

Pull on 10 Mbps

ECR / Month

Base Image

Each CI build pushes a new tag; old ones accumulate.

Added Layers

Quick-add layer:

No extra layers yet — quick-add above or enter custom.

Size Breakdown & Pull Times

Pull Time by Network Speed

Registry Storage Cost (monthly)

How to Use the Docker Image Size Calculator

Docker image size directly impacts CI/CD speed, cloud egress costs, and cold-start latency in Kubernetes and serverless environments. This Docker image size calculator lets you estimate your final image size before committing to a Dockerfile design — helping you catch bloat before it reaches production.

Step 1: Select a Base Image

Choose your base image from the presets or enter a custom size. Alpine Linux (~5 MB) is the most minimal choice and is ideal for compiled binaries or services with minimal runtime dependencies. If you need glibc compatibility (common for Python and Node.js), consider debian:slim (~80 MB). For Go services, consider starting from scratch (0 MB) with a static binary.

Step 2: Add Your Layers

Use the quick-add presets or enter custom layer names and sizes. Common layers include: apt/apk packages (50–200 MB), pip packages (50–300 MB), node_modules (100–500 MB for typical Node.js projects), application source code (1–50 MB), and static assets like compiled CSS/JS (5–100 MB). Each layer in a Dockerfile RUN command adds to the total — even if you rm -rf files in a later step.

Understanding Compressed vs. Uncompressed Size

The uncompressed size is what Docker reports with docker image ls. The compressed (gzipped) size is what gets pushed to and pulled from a registry — typically 40–60% smaller. Pull times are calculated from the compressed size since that's what traverses the network. Registry storage costs are also based on compressed size.

Registry Storage Costs

Enter the number of image versions (tags) stored in your registry. Each CI build typically pushes a new tag — if you retain 30 days of builds running 5 times per day, that's 150 image versions. The calculator shows monthly costs for Amazon ECR ($0.10/GB), Docker Hub (flat pricing tiers), and GitHub Container Registry (free for public, included in GitHub storage for private).

Optimization Strategies

The top ways to reduce Docker image size: (1) Use multi-stage builds to separate build dependencies from runtime. (2) Use alpine-based images instead of Debian/Ubuntu. (3) Combine RUN commands with && and clean up caches in the same layer (e.g., apt-get clean && rm -rf /var/lib/apt/lists/*). (4) For Node.js, use npm ci --production and exclude devDependencies. (5) Use .dockerignore to exclude node_modules, .git, and test files from the build context.

Frequently Asked Questions

Is this Docker image size calculator free?

Yes, completely free with no signup required. All estimates run in your browser — no Dockerfile or layer data is sent anywhere.

Is my data private?

Yes. Everything runs locally in your browser using JavaScript. No data you enter is transmitted to any server.

Why is the compressed size smaller than the uncompressed size?

Docker images are compressed with gzip when pushed to a registry. Compression reduces file size by roughly 40–60% depending on content type. Source code and text files compress very well (60–70% reduction); binary files and already-compressed assets compress less (10–30% reduction). The calculator uses a conservative ~40% compression estimate.

What is the smallest Docker base image?

Alpine Linux is the most popular minimal base at ~5–7 MB. Scratch (truly empty) is 0 MB but requires statically linked binaries. Distroless images (from Google) are 2–20 MB and remove package managers and shells for better security. For most production workloads, alpine or distroless is the right choice.

How do Docker layers affect image size?

Each instruction in a Dockerfile (RUN, COPY, ADD) creates a new layer. Layers are immutable and stacked — the final image is the sum of all layers. Importantly, even if you delete a file in a later RUN command, the data still exists in the earlier layer. To avoid this, chain commands with && in a single RUN instruction.

Why does node_modules make my image so large?

node_modules can easily reach 200–500 MB for typical Node.js projects because npm installs all dependencies including nested transitive ones. Solutions: use multi-stage builds (build in one stage, copy only production files to the final stage), use npm ci --production to skip devDependencies, or use tools like node-prune to remove test files, markdown, and TypeScript source from node_modules.

How much does Docker Hub or Amazon ECR cost for storage?

Docker Hub free tier allows one private repository and unlimited public repos with pull-rate limits. Docker Hub Pro/Team starts at $5/month per user. Amazon ECR charges $0.10 per GB per month for private repositories (first 500 MB free per month per account). GitHub Container Registry is free for public images, and included in GitHub packages storage quota for private images.

What is a multi-stage Docker build?

Multi-stage builds let you use multiple FROM instructions in a single Dockerfile. You build your application in a full SDK/builder image, then copy only the compiled artifacts into a minimal runtime image. This can reduce final image size by 70–90% — a Node.js app that would be 800 MB in a single stage can be 80 MB using multi-stage builds.