Browser-only · no uploads · no backend
See inside your
Docker image.
Drop a docker save tarball and get per-layer file diffs, wasted-space analysis, an efficiency score and the largest files — computed locally, in seconds, on your machine. Your image never leaves the browser.
docker save -o my-image.tar my-image:latest
Drop your image tarball here
the output of docker save image:tag -o image.tar
layerscope/sample:latest (92 KiB) — a real docker save archive with an add → modify → delete history
- 01Legacy + OCImanifest.json and index.json layouts, gzip layers via DecompressionStream
- 02Memory-safeReads the archive in slices; memory scales with the largest layer (tested up to 150 MiB per layer)
- 03dive-compatiblesame size, waste and efficiency definitions — cross-checked in CI
Parse the tar
Headers are read sequentially with File.slice. Legacy (manifest.json) and OCI (index.json + blobs/) layouts are both recognized; gzip layers stream through DecompressionStream.
Diff each layer
Every layer is compared against the squashed filesystem below it: files added, modified or deleted — including .wh. whiteout files and .wh..wh..opq opaque markers.
Score it
Files overwritten or removed in later layers still occupy space in earlier ones. layerscope computes wasted bytes and an efficiency score with dive's formula, plus the 20 largest files.
| # | Size | Layer size | Command |
|---|
layer –
—
—
The 20 largest files
—
| # | Path | Size | Share | Layer |
|---|
Why files can be “wasted”
Docker layers are immutable. When a later layer overwrites or deletes a file, the old bytes stay in the earlier layer forever. dive and layerscope count every occurrence of a path across layers; an image is efficient when few paths appear in multiple layers. Wasted is dive's number — it deliberately includes the copy that still exists, which keeps layerscope comparable with dive. Reclaimable is the smaller number you actually get back if you flatten the image into one layer.
- efficiencyΣ min(occurrence sizes) ÷ Σ cumulative sizes
- wasted bytesdive's definition: total bytes of every path seen in ≥ 2 layers or deleted — surviving copy included
- reclaimablewasted bytes − bytes of the copies that survive in the final squashed image
- wasted %wasted bytes ÷ (image size − first layer)
Whiteouts of removed directories are sized from the squashed filesystem below them. Opaque markers (.wh..wh..opq) hide lower files without counting as deletions. Sizes are tar-header sizes; hardlinks count as 0.
Wasted space by file
Paths present in more than one layer, largest first.
| Path | Copies | Cumulative | Share of waste | Share of waste (bar) |
|---|
No duplicated or deleted-then-readded paths — every path appears in exactly one layer. ✓