Docker 错误:设备上没有剩余空间 [英] Docker error : no space left on device
问题描述
我通过以下方式在 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 的建议:
From Kal's suggestions:
当我删除所有图像和容器时,它确实释放了一些空间,并且图像构建运行时间更长,然后失败并出现相同的错误.那么问题来了,这是指哪个空间,我该如何配置?
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?
推荐答案
目前的最佳做法是:
docker system prune
在接受结果之前请注意此命令的输出:
Note the output from this command prior to accepting the consequences:
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all dangling images
- all dangling build cache
Are you sure you want to continue? [y/N]
换句话说,继续执行此命令是永久性的.请记住,最佳实践是将 停止的容器视为ephemeral 即你应该使用 Docker 设计你的工作,不要保留这些停止的容器.您可能需要考虑使用 --rm
标志,如果您没有主动调试容器.
In other words, continuing with this command is permanent. Keep in mind that best practice is to treat stopped containers as ephemeral i.e. you should be designing your work with Docker to not keep these stopped containers around. You may want to consider using the --rm
flag at runtime if you are not actively debugging your containers.
确保你阅读了这个答案,re: Volumes
Make sure you read this answer, re: Volumes
如果 docker system prune
不起作用,您可能还对 这个答案 感兴趣给你.
You may also be interested in this answer, if docker system prune
does not work for you.
这篇关于Docker 错误:设备上没有剩余空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!