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
?
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
?
In the special case of Mac OS X or Windows, using boot2docker, your Docker images are stored within a VirtualBox VM managed by boot2docker.
This VM will be stored in normal place of VirtualBox images:
OS X:
~/VirtualBox VMs/boot2docker-vm
Windows:
%USERPROFILE%/VirtualBox VMs/boot2docker-vm
You can reset it by running (WARNING: This will destroy all images you've built and downloaded so far):
This is especially useful if you kept tons of intermediate images when building / debugging a build without the useful --rm options, I quote them here for reference: Use:
instead of:
If you keep in mind that Docker is still running in a VM, the system paths are relative to the VM and not from the Mac Osx system. As it says all is contained in a VM file :
Try to run Alpine image with this volume option and the ls command you are able to list the VM host:
After this just try :
Now, you are able to list the docker folder from the WM host
I can answer this question only for Ubuntu users:
The root directory of docker can be found when you run the command
docker info
Docker directory will be given in this line: "
Docker Root Dir: /var/lib/docker
"About the docker images, they are stored inside the docker directory:
/var/lib/docker/aufs/diff/
Remember these things are not same in all version of docker. Currently, I am using 1.12.3.
On Fedora, Docker uses LVM for storage if available. On my system
docker info
shows:In that case, to increase storage, you will have to use LVM command line tools or compatible partition managers like blivet.
The images are stored in
/var/lib/docker/graph/<id>/layer
.Note that images are just diffs from the parent image. The parent ID is stored with the image's metadata
/var/lib/docker/graph/<id>/json
.When you
docker run
an image. AUFS will 'merge' all layers into one usable file system.As answered here, if you're on Mac, it is located at