1

我已经安装了“cAdvisor”来监控主机上的容器,现在每当我尝试停止并删除任何其他容器时,cAdvisor 都不允许删除其他容器。

`# docker ps -a | grep -i api
790ddf58f54a        container/container-abc         "/bin/sh -c 'sh -c..."   42 hours ago        Dead`
`# docker rm 790ddf58f54a
Error response from daemon: Unable to remove filesystem for 
790ddf58f54acf041b3e33bc040ea035d43be92315c7d970f411ad56a855e627: remove /var/lib/docker/containers/790ddf58f54acf041b3e33bc040ea035d43be92315c7d970f411ad56a855e627/shm: device or resource busy`
`# docker rm 790ddf58f54a
Error response from daemon: Unable to remove filesystem for 
790ddf58f54acf041b3e33bc040ea035d43be92315c7d970f411ad56a855e627: remove` `/var/lib/docker/containers/790ddf58f54acf041b3e33bc040ea035d43be92315c7d970f411ad56a855e627/shm: device or resource busy`

当我停止 cAdvisor 时,它允许我移除容器。

`# docker ps | grep -i cadvisor
b54e4acb3f36        google/cadvisor                 "/usr/bin/cadvisor..."   21 hours ago        Up 21 hours         0.0.0.0:9911->8080/tcp                                                                                           cadvisor`
`# docker stop b54e4acb3f36
b54e4acb3f36`
`# docker rm 790ddf58f54a
790ddf58f54a

我参考了这个 github 问题,但没有帮助https://github.com/moby/moby/issues/34198。还对此进行了进一步搜索,是否有任何永久修复此问题的方法。

1) container/container-abc 正在使用以下命令生成。

# docker run -d --restart=on-failure:5 --name=container-abc -p 15200:15200 -p 15201:15201 container-abc-image

2)我正在使用docker-compose for cadvisor,下面是docker compose的内容。

services:
cadvisor:
    image: google/cadvisor
    container_name: cadvisor
    volumes:
       - /:/rootfs:ro
       - /var/run:/var/run:rw
       - /sys:/sys:ro
       - /var/lib/docker/:/var/lib/docker:ro
    ports:
       - 9911:8080
    privileged: true
    restart: always

3) 下面是 docker info 命令。

# docker info
Containers: 38
 Running: 24
 Paused: 0
 Stopped: 14
Images: 310
Server Version: 1.13.1
Storage Driver: overlay
 Backing Filesystem: extfs
 Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1
runc version: 9df8b306d01f59d3a8029be411de015b7304dd8f
init version: 949e6fa
Security Options:
 apparmor
Kernel Version: 3.12.74-60.64.85-default
Operating System: SUSE Linux Enterprise Server 12 SP1
OSType: linux
Architecture: x86_64
CPUs: 32
Total Memory: 31.27 GiB
ID: BTZ2:KQZM:VGL5:DN7P:LKEB:JMDY:57N6:JUC2:LIBA:UZWA:EU3T:CHWP
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 171
 Goroutines: 132
 System Time: 2018-07-16T03:58:55.156080332-07:00
 EventsListeners: 0
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
WARNING: No kernel memory limit support
Experimental: false
Insecure Registries:
 172.24.227.60:8090
 127.0.0.0/8
Live Restore Enabled: false

提前致谢。

4

0 回答 0