我想增加 Docker 容器的磁盘空间。这是 docker info 的输出。
Containers: 3
Running: 3
Paused: 0
Stopped: 0
Images: 4
Server Version: 19.03.5
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
我读到默认情况下磁盘空间为10GB,据说overlay2 取消了这个限制。我的情况似乎并非如此。
docker run -d --name jd2 --restart always -v $HOME/docker/volumes/jd2:/opt/JDownloader/cfg -v $HOME/downloads:/opt/JDownloader/Downloads plusminus/jdownloader2-headless
最佳答案
I have read that the disk space is 10GB by default, supposedly this limit is dropped with overlay2. This does not seem to be the case for me.
这不准确。
Docker 的早期版本在 CentOS 上使用 devicemapper 存储驱动程序,它为每个容器创建一个新的虚拟 block 设备。在本例中,每个容器的默认大小为 10GB,可以通过 dm.basesize 存储选项进行控制。
由于内核更新和额外的开发工作,CentOS 和大多数其他发行版上的默认存储驱动程序是 overlay2
存储驱动程序。这不再依赖于每个容器的 block 设备,而是使用 overlayfs 。这样做的实际影响之一是不再有每个容器的存储限制:所有容器都可以访问 /var/lib/docker
下的所有空间。不再有任何类型的每个容器 10GB 限制。
有关 the overlay2 storage driver 的更多信息,请参阅文档.
如果 /var/lib/docker
中的空间不足,您可以像添加任何其他文件系统一样添加空间。
关于docker - 增加 CentOS 上的 Docker 容器存储大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59610957/