Where are Docker images stored on the host machine?

+1 vote
I managed to find the containers under directory /var/lib/docker/containers, but I can't find the images.

What are the directories and files under /var/lib/docker and where can i find the images?
Jul 18, 2018 in Docker by Nilesh
• 6,880 points
2,091 views

5 answers to this question.

+2 votes
Best answer
The contents of the /var/lib/docker directory vary depending on the driver Docker is using for storage.

By default this will be aufs but can fall back to overlay, overlay2, btrfs, devicemapper or zfs depending on your kernel support. In most places this will be aufs.

You can manually set the storage driver with the -s or --storage-driver= option to the Docker daemon.

·         /var/lib/docker/{driver-name} - will contain the driver specific storage for contents of the images.

·         /var/lib/docker/graph/<id> -now only contains metadata about the image, in the json and layersize files.

In the case of aufs:

·         /var/lib/docker/aufs/diff/<id>- has the file contents of the images.

·         /var/lib/docker/repositories-aufs -is a JSON file containing local image information. This can be viewed with the command docker images.

In the case of devicemapper:

·         /var/lib/docker/devicemapper/devicemapper/data stores the images

/var/lib/docker/devicemapper/devicemapper/metadata the metadata
answered Jul 18, 2018 by Kalgi
• 2,620 points

selected Apr 26 by Omkar
+1 vote

For Mac OS X

~/VirtualBox VMs/boot2docker-vm

Mac OS X using boot2docker 

/Users/rajesh.kumar/.docker/machine/machines/default

File Name – disk.vmdk

answered Apr 26 by Mannu
+1 vote

For most of the Linux versions:

/var/lib/docker/aufs/diff/<id> has the file contents of the images.

/var/lib/docker/repositories-aufs is a JSON file containing local image information. This can be viewed with the command docker images.

answered Apr 26 by Jobin
+1 vote

For device mapper (Redhat)

/var/lib/docker/devicemapper/devicemapper/data – stores the images

/var/lib/docker/devicemapper/devicemapper/metadata – the metadata

answered Apr 26 by Inayat
+1 vote

For Windows:

%USERPROFILE%/VirtualBoxVMs/boot2docker-vm

You can manually set the storage driver with the -s or –storage-driver= option to the Docker daemon.

/var/lib/docker/{driver-name} will contain the driver specific storage for contents of the images.

/var/lib/docker/graph/<id> now only contains metadata about the image, in the json and layersize files.

answered Apr 26 by Laksha

Related Questions In Docker

0 votes
1 answer

Docker ports are working on the localhost but not with public ip

Probably, the reason is that you've included ...READ MORE

answered Jun 12, 2018 in Docker by Damon Salvatore
• 5,510 points

edited Oct 15, 2018 by Kalgi 266 views
+4 votes
4 answers

How To Access a Service on Host From a Docker Container?

Adding to kalgi's answer, You can also ...READ MORE

answered Oct 16, 2018 in Docker by lina
• 8,110 points

edited Oct 16, 2018 by lina 4,305 views
0 votes
1 answer

Different file owner inside Docker container and in host machine Ask

Filesystems, at least in Unix- and Linux-like ...READ MORE

answered Jun 25, 2018 in Docker by Damon Salvatore
• 5,510 points
72 views
0 votes
1 answer

Different file owner inside Docker container and in host machine

Here is what you can try. Since ...READ MORE

answered Jun 27, 2018 in Docker by Atul
• 10,240 points
189 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,540 points
156 views
0 votes
1 answer

Where is the Docker daemon log?

It depends on your OS. Here are ...READ MORE

answered Jul 18, 2018 in Docker by Kalgi
• 2,620 points
466 views