Where are Docker images stored on the host machine

+2 votes
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
• 7,050 points
11,810 views

5 answers to this question.

+3 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,680 points

selected Apr 26, 2019 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, 2019 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, 2019 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, 2019 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, 2019 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,980 points

edited Oct 15, 2018 by Kalgi 3,927 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,220 points

edited Oct 16, 2018 by lina 33,011 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,980 points
734 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
1,730 views
+2 votes
1 answer
+2 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
• 58,090 points
2,469 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,680 points
3,816 views
+1 vote
2 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP