简体   繁体   English

Docker主机并且设备上没有剩余空间

[英]Docker host & no space left on device

I'am using Rancher to manage some EC2 hosts (4 nodes in an auto-scaling group) & to orchestrate containers. 我使用Rancher管理一些EC2主机(自动缩放组中的4个节点)并协调容器。 Everything works fine. 一切正常。

But, at some point, I have a recurrent problem of disk space, even if I remove unused and untagged images with this command 但是,在某些时候,我有一个经常出现的磁盘空间问题,即使我使用此命令删除未使用和未标记的图像

docker images --quiet --filter=dangling=true | xargs --no-run-if-empty docker rmi

Like I said, even if I run this command above, my hosts are continuoulsy running out of space : 就像我说的,即使我在上面运行这个命令,我的主机也会不断耗尽空间:

Filesystem      Size  Used Avail Use% Mounted on
udev            7.9G   12K  7.9G   1% /dev
tmpfs           1.6G  1.4M  1.6G   1% /run
/dev/xvda1       79G   77G     0 100% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none            5.0M     0  5.0M   0% /run/lock
none            7.9G  7.5M  7.9G   1% /run/shm
none            100M     0  100M   0% /run/user

I'am using rancher 1.1.4 and my hosts are running Docker 1.12.5 under Ubuntu 14.04.4. 我使用的是rancher 1.1.4,我的主机在Ubuntu 14.04.4下运行Docker 1.12.5。 LTS. LTS。

Is there something I miss? 有什么我想念的吗? What are the best practices to configure docker for production hosts in order to avoid this problem? 为生产主机配置docker的最佳做法是什么,以避免此问题?

Thank you for your help. 谢谢您的帮助。

Do you use volumes mounts ( docker run -v /local/path:/container/path ) for persistent data of your containers ? 您是否使用卷装入( docker run -v /local/path:/container/path )来获取容器的持久数据?

If no, data written by your containers (database, logs ...) will always grow the last layer of your image run. 如果不是,容器写入的数据(数据库,日志......)将始终增长图像运行的最后一层。

To see the real size of your current running containers : 要查看当前正在运行的容器的实际大小:

docker ps -s

You can also use tools such as https://www.diskreport.net to analyse your disk space and see what has grown between two measures. 您还可以使用https://www.diskreport.net等工具分析磁盘空间,并查看两个度量之间的增长情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM