Docker images are the foundation of packaged applications. They are practically snapshots of a file system and a set of instructions that specify how to execute a container. They can be created from scratch by utilizing a base image from a registry or by modifying an existing image. They are located on the local system and can be stored and shared on a registry, such as Docker Hub.
This article will demonstrate the methods to find Docker images on the host machine.
Where Can I Find Docker Images on the Local Host Machine?
The location of the Docker images depends on the operating system that is being used. Users can find the location of Docker images on a type of operating systems, such as:
Location of Docker Images on Linux
On Linux, the Docker images are typically located at the “/var/lib/docker/” location. Within this directory, users find subdirectories containing the various parts of a Docker image, such as the image layers and metadata.
Step 1: View the Location of the Docker Image
To find the location of Docker images on Linux, execute the below-listed command in the Ubuntu terminal:
In the above output, the highlighted part shows the location of Docker images on Linux.
Step 2: List Docker Images
Write out the provided command to display all the available Docker images on the local host system:
The above output shows all the Docker images on the local host system.
Step 3: Verify the Location of Docker Images
To verify the location of docker images, utilize the “docker image inspect <image-id>” command:
The highlighted part shows the directory and subdirectory of Docker images on Ubuntu.
Location of Docker Images on Windows
On Windows, the Docker images are stored in the Hyper-V virtual machine used by Docker. To access the cache, users can use the Docker Desktop app. To do so, first open Docker Desktop and navigate to the “Images” section:
In the above image, all the Docker images can be seen.
Moreover, users can run the below-provided command in Windows PowerShell to access the Docker images:
The above output displays all the local Docker images on Windows.
Conclusion
The location of the Docker images depends on the operating system that is being utilized by users. On Linux, the Docker image is located in the “/var/lib/docker/” directory. On Windows, the Docker images are stored in the Hyper-V virtual machine used by Docker. To access the Docker images, users can use the Docker Desktop application or Docker command-line interface. Moreover, to view all the Docker images stored on the host machine, the “docker images” command can be used in the terminal.