Ajeet Raina Docker Captain, ARM Innovator & Docker Bangalore Community Leader.

Pick of the Week: The “dive” Docker Hub Image

1 min read

Are you looking out for a tool that lets you explore a Docker image, see its layer contents, and discover a way to shrink your image size? Check out the Dive tool. 

With over 500k+ Docker Pulls and 33.1K GitHub downloads, Dive is a tool built by Alex Goodman. It is used for analyzing Docker image. It lets you view the contents of Docker images, and discovering ways to shrink the size of your Docker/OCI image.

Features:

  • Show Docker image contents broken down by layer
  • Indicate what’s changed in each layer
  • Estimate “image efficiency”
  • Quick build/analysis cycles
  • CI Integration
  • Multiple Image Sources and Container Engines Supported

Getting Started:

You can run dive directly on MacOS by using the homebrew:

brew install dive

Run the below command to run dive against the logs explorer extension:

dive docker/logs-explorer-extension:0.2.0

 

Press the “Tab” key to switch between the sections. You can view the current Docker image Layer details.

 

 

KeyBindings Cheatsheet:

Below is the list of shortcuts that might be useful:

Key Binding Description
Ctrl + C Exit
Tab Switch between the layer and filetree views
Ctrl + F Filter files
PageUp Scroll up a page
PageDown Scroll down a page
Ctrl + A Layer view: see aggregated image modifications
Ctrl + L Layer view: see current layer modifications
Space Filetree view: collapse/uncollapse a directory
Ctrl + Space Filetree view: collapse/uncollapse all directories
Ctrl + A Filetree view: show/hide added files
Ctrl + R Filetree view: show/hide removed files
Ctrl + M Filetree view: show/hide modified files
Ctrl + U Filetree view: show/hide unmodified files
Ctrl + B Filetree view: show/hide file attributes
PageUp Filetree view: scroll up a page
PageDown Filetree view: scroll down a page

 

Running dive using Docker container on Arm Platform

If you try to run wagoodman/dive:latest on your Apple Mac M1 Pro, then it mightn’t work as there is no support for Arm architecture. Instead, I suggest you to use jauderho/dive image.

docker run –rm -it \
-v /var/run/docker.sock:/var/run/docker.sock \
jauderho/dive:latest dive ajeetraina/webpage

 

Resources:

Please follow and like us:

Have Queries? Join https://launchpass.com/collabnix

Ajeet Raina Docker Captain, ARM Innovator & Docker Bangalore Community Leader.

Leave a Reply

Your email address will not be published. Required fields are marked *

© Copyright Collabnix Inc

Built for Collabnix Community, by Community