Use Case

Analyzing an Open-Source Spring Boot Docker Image with Dive

To truly understand the value of Dive, it's helpful to analyze a real Docker image. Rather than using a custom local build, we will examine a publicly available Spring Boot application image published by the Spring team.

Image: springio/gs-spring-boot-docker

We will use the image from the official Spring Boot Docker Getting Started Guide, which is available on Docker Hub as:

springio/gs-spring-boot-docker

This image is a simple "Hello World" Spring Boot application packaged as an executable JAR and containerized using a basic Dockerfile.

Pull the Image

First, pull the public image:

docker pull springio/gs-spring-boot-docker

This downloads the image locally so that Dive can inspect it.

Launch Dive

Now run Dive to explore the image:

dive springio/gs-spring-boot-docker

This opens Dive’s interactive terminal UI showing:

  • A breakdown of each image layer

  • The exact file system state after each Dockerfile instruction

  • File changes (added, removed, modified)

  • An overall efficiency score for the image

Understanding the Dive Output

The interface is split into two panels:

1. Left Panel – Layer and Image Metadata

This side provides a deep dive into the structure and efficiency of the Docker image.

Layers

  • This is the topmost section of the left panel.

  • Each entry here represents a layer in the Docker image.

  • Columns:

    • Cmp (Compression Color): Indicates what changed in that layer (added/modified/removed).

    • Size: Size of that layer.

    • Command: Shows the command that generated that layer (FROM, COPY, RUN, etc.).

  • In the screenshot:

    • First layer is 1.8 MB created from the base (FROM blobs).

    • Others show results of bazel build and jib-maven-plugin commands.

Layer Details

  • Appears when you select any layer in the list above.

  • Shows metadata about that individual layer, such as:

    • Tags: Image tags (if available).

    • Id: The name of the layer source.

    • Size: Layer size.

    • Digest: Unique SHA256 digest hash of the layer.

    • Command: Dockerfile or tooling command used to generate the layer.

  • Helps identify which layer caused what file changes.

Image Details

  • Located below Layer Details.

  • Shows summary metrics about the entire image:

    • Image name: In this case, springio/gs-spring-boot-docker

    • Total Image Size: 143 MB

    • Potential Wasted Space: 0 B → Very efficient image.

    • Image Efficiency Score: 100% → No duplicate files or unnecessary bloat.

  • Useful to analyze image quality from a performance and delivery perspective.

Right Panel – Current Layer Contents

This panel reflects the file system at the selected layer. You can think of it as a live diff view for the layer you’re inspecting.

  • Tree structure of files and folders at that layer.

  • Each file shows:

    • Permissions

    • UID:GID (owner)

    • Size

  • This helps you inspect:

    • What got added in this layer?

    • What files or folders are taking up space?

    • Are credentials, logs, or temp files accidentally being included?

In our image

  • You see a complete Linux filesystem (/bin, /etc, /usr, /home, etc.).

  • Dive allows you to navigate into folders using keyboard arrows to inspect exact contents.

  • You can also toggle filters, compare changes layer-by-layer (A key), and see what changed compared to the previous layer.

Shortcuts

Shortcut Key
Action Description

Tab

Switch focus between left pane (layers) and right pane (filesystem)

/

Navigate up/down through the layers or file list

/

In file tree, expand/collapse directories

Enter

View details of the selected file/directory

q or Ctrl+C

Quit Dive

a

Toggle aggregate view of all layers (shows total impact)

l

Toggle layer changes view (shows what changed in each layer)

f or Ctrl+F

Toggle filter view (hide or show irrelevant files like cache/logs)

?

Show help screen with all keybindings

Space

Expand/Collapse all folders in file tree (when in the right pane)

Last updated