Compare Docker Images

Paste docker inspect output for two images to compare them side by side. See differences in size, layers, environment variables, exposed ports, base image, and configuration instantly.

Side-by-Side Diff Layer Comparison Size Diff ENV Variable Diff Port Comparison Free · No Login

What This Tool Compares

Image Size

Compare total size of both images with a visual bar chart. See exactly how much larger or smaller one image is vs the other.

Layer Diff

Compare RootFS layers between both images. See shared layers, layers only in Image A, and layers only in Image B.

ENV Variables

Side-by-side comparison of all environment variables. Highlights variables that exist in one image but not the other, and values that changed.

Exposed Ports

Compare which ports are exposed in each image. Flags ports added or removed between versions and highlights sensitive ports.

Base Configuration

Compare architecture, OS, Docker version, working directory, entry point, CMD, and user settings between both images.

Tags & Metadata

Compare creation dates, authors, repository tags, and image IDs to understand the provenance of each image.

How to Compare Two Docker Images

  1. Get inspect output for Image A: docker inspect IMAGE_A_NAME
  2. Get inspect output for Image B: docker inspect IMAGE_B_NAME
  3. Paste each JSON into the corresponding panel above.
  4. Click Compare Images to generate the side-by-side diff.

Click Load Sample Data to see the comparison tool in action with two pre-built image examples (Node 14 vs Node 20).

Why Compare Docker Images?

Understanding Docker Image Layers

Docker images are built in layers. Each instruction in a Dockerfile — RUN, COPY, ADD — creates a new read-only layer. Layers are identified by their SHA256 digest and are shared across images that use the same base.

When comparing two images, shared layers are already cached locally and don't need to be re-downloaded. Different layers represent actual changes between images. Fewer different layers means faster updates and smaller transfers.

How Docker Layer Caching Works

Docker caches each layer by its content hash. If two images share a layer digest, they literally share the same data on disk. This is why images built from the same base image (like node:20-alpine) can share hundreds of megabytes of layers, making pulls much faster for subsequent versions.

Frequently Asked Questions

What is the best way to compare Docker images?

The most thorough way is to use docker inspect to compare configuration metadata, docker history to compare build layers, and docker diff to compare filesystem changes in running containers. This tool handles the docker inspect comparison — paste both outputs to see a structured diff.

Can I compare images from different registries?

Yes. As long as you have pulled both images locally and can run docker inspect on each, the tool will compare them regardless of which registry they came from — Docker Hub, ECR, GCR, GHCR, or a private registry.

How do I compare Docker image sizes?

Run docker images to see sizes, or docker inspect IMAGE --format='{{.Size}}' for exact bytes. This tool extracts the size from docker inspect JSON and shows a visual comparison bar between both images.

What does it mean when two images share layers?

Shared layers (same SHA256 digest) mean both images were built on the same foundation — typically the same base image version. Docker only stores one copy of shared layers on disk, saving space. It also means pulling the updated image only requires downloading the new layers, not the shared ones.