无法移除死的docker容器。存储驱动程序:btrfs

时间:2016-09-14 07:46:59

标签: docker btrfs

我无法移除死箱。当我尝试移除容器时,我得到:

$ docker rm -f d1dd3082f7bb
Error response from daemon: Unable to remove filesystem for d1dd3082f7bbfc2310e497d0af47d51a8ca4e6e90a0d565a85d033f96a12325f: remove /var/lib/docker/containers/d1dd3082f7bbfc2310e497d0af47d51a8ca4e6e90a0d565a85d033f96a12325f/shm: device or resource busy

之前从未遇到过这样的问题。有关当前设置的一些信息:

$ uname -a
Linux AUIS1 3.16.6-2-default #1 SMP Mon Oct 20 13:47:22 UTC 2014 (feb42ea) x86_64 x86_64 x86_64 GNU/Linux

$ docker info
Containers: 19
Running: 15
 Paused: 0
 Stopped: 4
Images: 19
Server Version: 1.12.1
Storage Driver: btrfs
 Build Version: Btrfs v3.16+20140829
 Library Version: 101
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: overlay bridge null host
Swarm: inactive
Runtimes: oci runc
Default Runtime: oci
Security Options: apparmor
Kernel Version: 3.16.6-2-default
Operating System: openSUSE 13.2 (Harlequin) (x86_64)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 15.66 GiB
Name: AUIS1
ID: PPHC:6VP2:PWW4:2JLX:I2UI:FZ3M:LWEQ:ZR6H:RV2K:HWRQ:VUCD:OPUH
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
WARNING: No kernel memory limit support
Cluster Store: consul://10.10.1.7:8500
Cluster Advertise: 10.10.1.7:2375
Insecure Registries:
 127.0.0.0/8

如何安全地删除它们?

忘记提及这些容器由docker swarm和compose管理。

$ docker ps -a
CONTAINER ID        IMAGE                                                 COMMAND                   CREATED             STATUS              PORTS                                                                                                                                                               NAMES
4a1193af7710        6ca7469301cb                                          "/bin/sh -c 'exec jav"    5 days ago          Dead                                                                                                                                                                                    4a1193af7710_4a1193af7710_4a1193af7710_xxxxxx2
f0446365fb75        e56d2658c291                                          "/bin/sh -c 'exec jav"    5 days ago          Dead                                                                                                                                                                                    f0446365fb75_f0446365fb75_f0446365fb75_f0446365fb75_xxxxx1
243e27c2cdf3        50e38ce0458f                                          "docker-entrypoint.sh"    6 days ago          Dead                                                                                                                                                                                    243e27c2cdf3_243e27c2cdf3_243e27c2cdf3_redis

添加尸体检查死容器inspect output

$ docker inspect 4a1193af7710

1 个答案:

答案 0 :(得分:0)

grep d1dd3082f7bbfc2310e497d0af47d51a8ca4e6e90a0d565a85d033f96a12325f /proc/*/mountinfo

然后找到d1dd3082f7bbfc2310e497d0af47d51a8ca4e6e90a0d565a85d033f96a12325f的pid并将其杀死