正常更新 Ubuntu 14.04 后无法启动 docker 个容器

Failed to start docker containers after normal updating Ubuntu 14.04

我的系统是Ubuntu 14.04,原始内核是3.13

$ uname -a
Linux dai-fp-adrecognizer 3.13.0-161-generic #211-Ubuntu SMP Wed Oct 3 14:52:35 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

我的容器过去在系统上 运行 很好。 docker-compose.yml如下:

version: '3'
services:
  scheduler:
    image: dreg.be/tvacr/dai-ws-server:1.0.2
    volumes:
      - /etc/dai-wsserver/ws_server_conf.ini:/etc/dai-wsserver/ws_server_conf.ini
    ports:
      - 6789:6789
    command: /etc/dai-wsserver/ws_server_conf.ini

今天下午我确实在 this instruction 之后在我的系统上安装了 ffmpeg。基本上执行了以下命令:

sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install ffmpeg

之后我得知我的容器突然停止了。我试图重新启动它,但它总是无法打印出这个错误:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:297: copying bootstrap data to pipe caused \"write init-p: broken pipe\"": unknown.

搜索后我发现 a bug report for the issue. I then followed the most upvoted comment 建议将内核升级到 4.4:

sudo apt-get install --install-recommends linux-generic-lts-xenial
sudo reboot

现在我的内核是4.4:

$ uname -a
Linux dai-fp-adrecognizer 4.4.0-146-generic #172~14.04.1-Ubuntu SMP Fri Apr 5 16:51:29 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

但是我的容器仍然无法开始打印出不同的错误:

$ docker-compose up
Creating dai-wsserver_scheduler_1 ... error

ERROR: for dai-wsserver_scheduler_1  Cannot create container for service scheduler: error creating aufs mount to /var/lib/docker/aufs/mnt/79d5913e12e2439a40f1dfbfa2b6b615ef476f5c2c4694e0dd8726bb17e52dae-init: no space left on device

ERROR: for scheduler  Cannot create container for service scheduler: error creating aufs mount to /var/lib/docker/aufs/mnt/79d5913e12e2439a40f1dfbfa2b6b615ef476f5c2c4694e0dd8726bb17e52dae-init: no space left on device
ERROR: Encountered errors while bringing up the project.

我确实检查了 space 留在我的系统上,一切看起来都不错:

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            7.9G   12K  7.9G   1% /dev
tmpfs           1.6G  344K  1.6G   1% /run
/dev/xvda1       12G  6.7G  4.5G  61% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none            5.0M     0  5.0M   0% /run/lock
none            7.9G  7.9G     0 100% /run/shm
none            100M     0  100M   0% /run/user

$ sudo du -h --max-depth=1 /var/lib/docker/aufs
288K    /var/lib/docker/aufs/layers
300K    /var/lib/docker/aufs/mnt
2.7G    /var/lib/docker/aufs/diff
2.7G    /var/lib/docker/aufs

我不知道我的系统发生了什么以及如何修复它。感谢您的帮助!

它在安装 ffmpeg(以及相关的系统更改)之前有效;当一切正常时,你能回滚到 'known good' 状态吗?从那时起,我会看看 ffmpeg 对系统做了什么改变;这就是错误的根本原因所在。

this 之后,我确实找到了解决我的问题的方法。简而言之,我清除了 aufs /var/lib/docker

下的内容
sudo service docker stop
sudo rm -rf /var/lib/docker/aufs
sudo rm -f /var/lib/docker/linkgraph.db
sudo service docker start

当然所有图片都会消失。不过没关系,我可以 re-pull 图片。