← Back to DiveScope
DiveScope Guide
Step 1: Export Your Docker Image
Use docker save to export any local image as a tar file:
docker save myapp:latest > myapp.tar
# or
docker save myapp:latest -o myapp.tar
This works with any image in your local Docker daemon — pulled from a registry or built locally.
Step 2: Open DiveScope
Go to dive.nullkit.com and drag your .tar file onto the drop zone. You can also click the drop zone to use a file picker.
Step 3: Explore the Results
DiveScope shows four tabs of analysis:
- Layers — Every layer with its Dockerfile command, size, and creation date. Size bars show relative layer sizes at a glance.
- Config — Image runtime configuration: CMD, ENTRYPOINT, ENV, exposed ports, working directory, labels, and more.
- Size Analysis — Visual charts showing layer size distribution (pie) and cumulative size growth (bar).
- Dockerfile — A best-effort reconstruction of the original Dockerfile from image history metadata.
Understanding Docker Layers
Each Dockerfile instruction creates a layer in the image. Key concepts:
- ADD/COPY — Adds files from the build context. These create real filesystem layers.
- RUN — Executes a command and captures the filesystem changes as a layer.
- ENV, EXPOSE, CMD, ENTRYPOINT, WORKDIR — These are metadata-only "empty layers" with zero size.
Tips for Reducing Image Size
- Use multi-stage builds — Build in one stage, copy only artifacts to a minimal final stage.
- Combine RUN commands — Each RUN creates a layer. Combine related commands with
&&.
- Clean up in the same layer —
apt-get install -y pkg && rm -rf /var/lib/apt/lists/*
- Use Alpine or distroless — Minimal base images save hundreds of MB.
- Use .dockerignore — Exclude unnecessary files from the build context.
- Order layers by change frequency — Put rarely-changing layers (dependencies) before frequently-changing ones (source code).
FAQ
How do I export a Docker image as a tar file?
Run docker save <image-name> > image.tar or docker save <image-name> -o image.tar in your terminal.
Does DiveScope upload my Docker image?
No. All processing happens locally in your browser. Your files never leave your machine.
What Docker image formats are supported?
DiveScope supports both legacy Docker V2 format (Docker <25) and modern OCI layout format (Docker 25+).
How can I reduce my Docker image size?
Use multi-stage builds, minimize the number of layers, combine RUN commands, use .dockerignore, choose minimal base images like Alpine, and clean up package caches in the same layer.