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
?
Volumes are stored in a part of the host filesystem which is managed by Docker ( /var/lib/docker/volumes/ on Linux). Non-Docker processes should not modify this part of the filesystem. Volumes are the best way to persist data in Docker. Bind mounts may be stored anywhere on the host system.
If you want to access the image data directly, it's usually stored in the following locations: Linux: /var/lib/docker/ Windows: C:ProgramDataDockerDesktop. macOS: ~/Library/Containers/com.
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
but the RedHats went with devicemapper
.
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 metadataIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With