Docker图像存储在主机上? [英] Where are Docker images stored on the host machine?
问题描述
我设法在目录 / 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
下的目录和文件是什么?
What are the directories and files under /var/lib/docker
?
推荐答案
/ var / lib / docker
目录的内容取决于驱动程序Docker用于存储。
The contents of the /var/lib/docker
directory vary depending on the driver Docker is using for storage.
默认情况下,这将是 aufs
,但可以退回到 overlay
, overlay2
, btrfs
, devicemapper
code> zfs 取决于你的内核支持。在大多数地方,这将是 aufs
,但 RedHats与 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守护进程。
You can manually set the storage driver with the -s
or --storage-driver=
option to the Docker daemon.
-
/ var / lib / docker / {driver-name}
将包含驱动程序专用存储图像内容。 -
/ var / lib / docker / graph /< id>
现在只包含有关图像的元数据,在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 /< id>
具有图像的文件内容。 -
/ 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 /存储图像
-
/ var / lib / docker / devicemapper / devicemapper /元数据
元数据 - 请注意,这些文件是精简配置的稀疏文件,因此它们不像看起来那么大。
/var/lib/docker/devicemapper/devicemapper/data
stores the images/var/lib/docker/devicemapper/devicemapper/metadata
the metadata- Note these files are thin provisioned "sparse" files so aren't as big as they seem.
这篇关于Docker图像存储在主机上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!