• Home
  • LLMs
  • Python
  • Docker
  • Kubernetes
  • Java
  • All
  • About
Docker | Image Filesystem
  1. Inspect Image Filesystem
  2. Show the history of an image
  3. Export the files of an image
  4. Using dive tool to explore images

  1. Inspect Image Filesystem
    To inspect an image, use the command "image inspect":

    You can look at the "GraphDriver.Data" element in the json output and use the data directories to list the contents of the image:

    The "RootFS.Layers" element list the image layers:
  2. Show the history of an image
    Let's have a look at the image history:

    The hello-world docker image contains only the layers of the base image (hello-world).
    You can see the layers created by the COPY and CMD instructions.

    If you look at the Dockerfile of the "hello-world" image, you will notice that it only copy the "hello" file:
  3. Export the files of an image
    To export the files of an image, use the command "docker export" on a running container.

    Let's create a container and export its contents:

    The "hello" file is the only non-empty file in the container.

    The other files and directories in the container are mandatory (required by the kernel). They all show zero bytes in length and Docker will automatically bind-mount them from the Docker host into the container when it's created.
  4. Using dive tool to explore images
    Please check this page for more details about dive tool: https://github.com/wagoodman/dive

    Installing dive on Ubuntu:

    Using dive:
    dive screenshot - ubuntu image latest
© 2025  mtitek