Docker错误:设备上没有剩余空间 [英] Docker error : no space left on device

查看:497
本文介绍了Docker错误:设备上没有剩余空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过以下方式在Debian 7计算机上安装了docker

I installed docker on a Debian 7 machine in the following way

$ echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list
$ sudo apt-get update
$ curl -sSL https://get.docker.com/ubuntu/ | sudo sh

之后,当我第一次尝试创建图像时,它失败并显示以下错误

After that when I first tried creating an Image it failed with the following error

 time="2015-06-02T14:26:37-04:00" level=info msg="[8] System error: write /sys/fs/cgroup/docker/01f5670fbee1f6687f58f3a943b1e1bdaec2630197fa4da1b19cc3db7e3d3883/cgroup.procs: no space left on device"

这是码头工人信息

Containers: 2
Images: 21
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 25
Dirperm1 Supported: true
Execution Driver: native-0.2
Kernel Version: 3.16.0-0.bpo.4-amd64
Operating System: Debian GNU/Linux 7 (wheezy)
CPUs: 2
 Total Memory: 15.7 GiB


WARNING: No memory limit support
 WARNING: No swap limit support

如何增加内存?系统配置存储在哪里?

How can I increase the memory? Where are the system configurations stored?

根据Kal的建议:

当我删除所有图像和容器时,它确实释放了一些空间,并且在生成相同错误之前,图像构建运行了更长的时间.所以问题是,这是指哪个空间以及如何配置它?

When I got rid of all the images and containers it did free some space and the image build ran longer before failing with the same error. So the question is, which space is this referring to and how do I configure it?

推荐答案

我遇到了相同的错误,并以此方式解决了该问题:

I had the same error and solve it this way:

1.删除Docker中的孤立卷,可以使用内置的docker volume命令.内置命令还会删除/var/lib/docker/volumes中不是卷的任何目录,因此请确保您未在​​其中保存任何要保存的目录.

1 . Delete the orphaned volumes in Docker, you can use the built-in docker volume command. The built-in command also deletes any directory in /var/lib/docker/volumes that is not a volume so make sure you didn't put anything in there you want to save.

如果您有一些要保留的数据,请特别小心

Warning be very careful with this if you have some data you want to keep

清理:

$ docker volume rm $(docker volume ls -qf dangling=true)

其他命令:

列出悬空的体积:

$ docker volume ls -qf dangling=true

列出所有卷:

$ docker volume ls


2.还可以考虑删除所有未使用的图像.


2 . Also consider removing all the unused Images.

首先清除<none>图像(有时会在构建图像时生成这些图像,并且如果由于某种原因而中断了图像构建,它们会停留在该位置).

First get rid of the <none> images (those are sometimes generated while building an image and if for any reason the image building was interrupted, they stay there).

这是我用来删除它们的漂亮脚本

here's a nice script I use to remove them

docker rmi $(docker images | grep '^<none>' | awk '{print $3}')

然后,如果您正在使用Docker Compose在本地为每个项目构建映像.最后,您将得到很多通常以您的文件夹命名的图像(例如,如果您的项目文件夹名为Hello,您将找到名称为Hello_blablabla的图像).所以还要考虑删除所有这些图像

Then if you are using Docker Compose to build Images locally for every project. You will end up with a lot of images usually named like your folder (example if your project folder named Hello, you will find images name Hello_blablabla). so also consider removing all these images

您可以编辑上述脚本以将其删除或使用

you can edit the above script to remove them or remove them manually with

docker rmi {image-name}

这篇关于Docker错误:设备上没有剩余空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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