gpt4 book ai didi

docker - 为什么我的 docker 卷用完了磁盘空间?

转载 作者:行者123 更新时间:2023-12-02 19:22:19 25 4
gpt4 key购买 nike

我正在使用持久卷。安装在容器中时,我收到一条错误消息,指出设备上没有剩余空间。经检查,卷大小为 256GB。但是,主机上有更多的空间。

更多细节: docker 存储驱动程序是 overlay2 . df显示有一个文件系统 /dev/mapper/vg1-docker那是256GB。在下载期间(通过互联网),该文件系统已 100% 满,docker没有自动调整文件系统的大小以腾出更多空间,即使主机上有更多可用空间。

主机是 native linux (ubuntu)。这是 df -i 的输出:

Filesystem               Inodes  IUsed    IFree IUse% Mounted on
udev 24754746 429 24754317 1% /dev
tmpfs 24757974 762 24757212 1% /run
/dev/xvda2 6537216 142008 6395208 3% /
tmpfs 24757974 1 24757973 1% /dev/shm
tmpfs 24757974 3 24757971 1% /run/lock
tmpfs 24757974 18 24757956 1% /sys/fs/cgroup
/dev/mapper/vg1-docker 16384000 985506 15398494 7% /var/lib/docker
/dev/xvda1 65536 313 65223 1% /boot
tmpfs 24757974 10 24757964 1% /run/user/1001

我找不到任何有关增加 docker 卷大小的信息。

请注意,这不是 Why has Docker volume run out of space? 的副本.

最佳答案

df reveals that there is a filesystem /dev/mapper/vg1-docker that is 256GB. During a download (over the internet) this filesystem became 100% full and docker did not automatically resize the filesystem to make more space, even though there was much more space available on the host.



我相信你自己已经回答了这个问题。 Docker 磁盘空间不足,因为您将其隔离到的分区磁盘空间不足。 Docker 不会,也不应该自动调整磁盘空间大小。这是系统管理员的任务,而不是容器引擎。为 docker 创建一个单独的分区的目的通常是为了确保 docker 不会占用根文件系统上的所有磁盘空间,这可能会导致整个主机崩溃。

关于docker - 为什么我的 docker 卷用完了磁盘空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58776842/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com