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
Use docker info command to display system-wide information and the location may vary.
Depending on the storage driver in use, additional information can be shown, such as pool name, data file, metadata file, data space used, total data space, metadata space used, and total metadata space.
The data file is where the images are stored and the metadata file is where the meta data regarding those images are stored. When run for the first time Docker allocates a certain amount of data space and meta data space from the space available on the volume where
/var/lib/docker
is mounted.
Here is the example on Ubuntu (check Root Dir):
$ docker info
...
Server Version: 18.06.1-ce
Storage Driver: aufs
Root Dir: /var/snap/docker/common/var-lib-docker/aufs
...
Docker Root Dir: /var/snap/docker/common/var-lib-docker
...
And here is the example on Travis CI (see Docker Root Dir):
$ docker info
Server Version: 17.09.0-ce
Storage Driver: overlay2
Backing Filesystem: extfs
...
Docker Root Dir: /var/lib/docker
...
You can use --format
parameter to extract that information into a single file, e.g.
$ docker info --format '{{.DriverStatus}}'
[[Root Dir /var/snap/docker/common/var-lib-docker/aufs] [Backing Filesystem extfs] [Dirs 265] [Dirperm1 Supported true]]
or:
$ docker info --format '{{json .DriverStatus}}'
[["Root Dir","/var/snap/docker/common/var-lib-docker/aufs"],["Backing Filesystem","extfs"],["Dirs","265"],["Dirperm1 Supported","true"]]