“设备上没有剩余空间”;即使取出所有容器 [英] "no space left on device" even after removing all containers

查看:126
本文介绍了“设备上没有剩余空间”;即使取出所有容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试Docker和Docker Compose时,我突然遇到设备上没有剩余空间的错误。我尝试使用类似问题中建议的方法删除所有内容,但无济于事。

While experimenting with Docker and Docker Compose I suddenly ran into "no space left on device" errors. I've tried to remove everything using methods suggested in similar questions, but to no avail.

我运行的事情:

$ docker-compose rm -v

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

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

$ docker system prune

$ docker container prune

$ docker rm $(docker stop -t=1 $(docker ps -q))

$ docker rmi -f $(docker images -q)

据我所知,现在真的不应该剩下任何东西了。看起来像这样:

As far as I'm aware there really shouldn't be anything left now. And it looks that way:

$ docker images    
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

相同的数量:

$ docker volume ls
DRIVER              VOLUME NAME

对于容器:

$ docker container ls   
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

不幸的是,我仍然遇到这样的错误:

Unfortunately, I still get errors like this one:

$ docker-compose up
Pulling adminer (adminer:latest)...
latest: Pulling from library/adminer
90f4dba627d6: Pulling fs layer
19ae35d04742: Pulling fs layer
6d34c9ec1436: Download complete
729ea35b870d: Waiting
bb4802913059: Waiting
51f40f34172f: Waiting
8c152ed10b66: Waiting
8578cddcaa07: Waiting
e68a921e4706: Waiting
c88c5cb37765: Waiting
7e3078f18512: Waiting
42c465c756f0: Waiting
0236c7f70fcb: Waiting
6c063322fbb8: Waiting
ERROR: open /var/lib/docker/tmp/GetImageBlob865563210: no space left on device

关于我的Docker安装的一些数据不存在空间:

Some data about my Docker installation:

$ docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 1
Server Version: 17.06.1-ce
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 15
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 6e23458c129b551d5c9871e5174f6b1b7f6d1170
runc version: 810190ceaa507aa2727d7ae6f4790c76ec150bd2
init version: 949e6fa
Security Options:
apparmor
seccomp
  Profile: default
Kernel Version: 4.10.0-32-generic
Operating System: Ubuntu 16.04.3 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.685GiB
Name: engelbert
ID: UO4E:FFNC:2V25:PNAA:S23T:7WBT:XLY7:O3KU:VBNV:WBSB:G4RS:SNBH
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support

和我的磁盘信息:

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            3,9G     0  3,9G   0% /dev
tmpfs           787M   10M  778M   2% /run
/dev/nvme0n1p3   33G   25G  6,3G  80% /
tmpfs           3,9G   46M  3,8G   2% /dev/shm
tmpfs           5,0M  4,0K  5,0M   1% /run/lock
tmpfs           3,9G     0  3,9G   0% /sys/fs/cgroup
/dev/loop0       81M   81M     0 100% /snap/core/2462
/dev/loop1       80M   80M     0 100% /snap/core/2312
/dev/nvme0n1p1  596M   51M  546M   9% /boot/efi
/dev/nvme0n1p5  184G   52G  123G  30% /home
tmpfs           787M   12K  787M   1% /run/user/121
tmpfs           787M   24K  787M   1% /run/user/1000

并且:

$ df -hi /var/lib/docker
Filesystem     Inodes IUsed IFree IUse% Mounted on
/dev/nvme0n1p3   2,1M  2,0M   68K   97% /

如上所述,我仍在尝试中,所以不确定是否已发布所有相关信息-让我知道您是否需要更多。

As said, I'm still experimenting, so I'm not sure if I've posted all relevant info - let me know if you need more.

任何人都不知道还有什么问题吗?

Anyone any idea what more could be the issue?

推荐答案

问题是 / var / lib / docker / f上ilesystem,它的索引节点用完了。您可以通过运行 df -i / var / lib / docker

The problem is that /var/lib/docker is on the / filesystem, which is running out of inodes. You can check this by running df -i /var/lib/docker

/ home 的文件系统具有足够的inode和磁盘空间,将Docker的工作目录移动到那里应该会重新运行它。

Since /home's filesystem has sufficient inodes and disk space, moving Docker's working directory there there should get it going again.

(请注意,前提是当前的Docker安装中没有任何有价值的东西。)

(Note that the this assumes there is nothing valuable in the current Docker install.)

首先停止Docker守护进程。在Ubuntu上,运行

First stop the Docker daemon. On Ubuntu, run

sudo service docker stop

然后将旧的 / var / lib / docker 移开:

sudo mv /var/lib/docker /var/lib/docker~

现在在 / home 上创建目录:

sudo mkdir /home/docker

并设置所需的权限:

sudo chmod 0711 /home/docker

/ var / lib / docker 目录链接到新的工作目录:

Link the /var/lib/docker directory to the new working directory:

sudo ln -s /home/docker /var/lib/docker

然后重新启动Docker守护程序:

Then restart the Docker daemon:

sudo service docker start

然后应该可以再次使用。

Then it should work again.

这篇关于“设备上没有剩余空间”;即使取出所有容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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