Docker图像存储在主机上? [英] Where are Docker images stored on the host machine?

查看:203
本文介绍了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 下的目录和文件是什么?

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 the json and layersize 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 command docker 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆