Docker 镜像存储在主机上的什么位置? [英] Where are Docker images stored on the host machine?
本文介绍了Docker 镜像存储在主机上的什么位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我设法在目录 /var/lib/docker/containers
下找到容器,但我找不到图像.
I managed to find the containers under directory /var/lib/docker/containers
, but I can't find the images.
/var/lib/docker
下有哪些目录和文件?
推荐答案
/var/lib/docker
目录的内容因 Docker 用于存储的驱动程序.
默认情况下这将是 aufs
但可以回退到 overlay
、overlay2
、btrfs
、devicemapper
或 zfs
取决于您的内核支持.在大多数地方,这将是 aufs
但RedHat 使用 devicemapper
.
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
.
您可以使用 -s
或 --storage-driver=
选项到 Docker 守护进程.
/var/lib/docker/{driver-name}
将包含图像内容的驱动程序特定存储./var/lib/docker/graph/
现在只包含关于图像的元数据,在json
和layersize
文件.
/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 thejson
andlayersize
files.
对于aufs
:
/var/lib/docker/aufs/diff/
包含图像的文件内容./var/lib/docker/repositories-aufs
是一个包含本地图像信息的 JSON 文件.这可以使用命令docker images
来查看.
/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 commanddocker images
.
对于devicemapper
:
/var/lib/docker/devicemapper/devicemapper/data
存储图像/var/lib/docker/devicemapper/devicemapper/metadata
元数据- 请注意,这些文件是精简配置的稀疏"文件,因此并没有看起来那么大.
这篇关于Docker 镜像存储在主机上的什么位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文