在CentOS上增加Docker容器的存储大小 [英] Increase Docker container storage size on CentOS

查看:167
本文介绍了在CentOS上增加Docker容器的存储大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想增加Docker容器的磁盘空间.这是docker info的输出.

I want to increase the disk space of a Docker container. Here is the output from 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降低了此限制.对我而言,情况似乎并非如此.

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 run -d --name jd2 --restart always  -v $HOME/docker/volumes/jd2:/opt/JDownloader/cfg -v $HOME/downloads:/opt/JDownloader/Downloads plusminus/jdownloader2-headless

推荐答案

我已经阅读到默认情况下磁盘空间为10GB,应该是使用overlay2降低了此限制.对我而言,情况似乎并非如此.

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 存储驱动程序,该驱动程序为每个容器创建一个新的虚拟块设备.在这种情况下,每个容器的默认大小为10GB,可以由 dm.basesize 存储选项控制.

Earlier releases of Docker used the devicemapper storage driver on CentOS, which creates a new virtual block device for each container. In this case, the default per-container size was 10GB, and could be controlled by the dm.basesize storage option.

由于内核更新和其他开发工作,CentOS和大多数其他发行版上的默认存储驱动程序是 overlay2 存储驱动程序.这不再依赖于每个容器的块设备,而是使用 overlayfs.这样做的实际影响之一是不再有每个容器的存储限制:所有容器都可以访问/var/lib/docker 下的所有空间.每个容器不再有10GB的限制.

Thanks to kernel updates and additional development work, the default storage driver on CentOS and most other distributions is the overlay2 storage driver. This no longer relies on a per-container block device, and instead makes use of overlayfs. One of the practical impacts of this is that there is no longer a per-container storage limit: all containers have access to all the space under /var/lib/docker. There is no longer any sort of per-container 10GB limit.

有关 overlay2存储驱动程序的更多信息,请参阅文档.

See the documentation for more information about the overlay2 storage driver.

如果/var/lib/docker 中的空间不足,则可以像添加其他任何文件系统一样添加空间.

If you are running out of space in /var/lib/docker, you can add space as you would for any other filesystem.

这篇关于在CentOS上增加Docker容器的存储大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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