|
1
|
Failed to remove image (bceaae03d0ea): Error response from daemon: conflict: unable to delete bceaae03d0ea (must be forced) - image is being used by stopped container 31142aabc63c |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
查看镜像[root@salt-master ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE<none> <none> bceaae03d0ea 15 hours ago 172 MB516249940/centos6-ssh v1 f6bb69ea7020 19 hours ago 556.4 MBcentos6-ssh latest f6bb69ea7020 19 hours ago 556.4 MBdocker.io/centos centos6 8315978ceaaa 4 weeks ago 194.6 MBdocker.io/ubuntu 12.10 3e314f95dcac 2 years ago 172 MB查看所有容器[root@salt-master ~]# docker ps -aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES31142aabc63c bceaae03d0ea "/bin/sh -c 'apt-get " 15 hours ago Exited (100) 15 hours ago drunk_borgf8aa111d0066 centos6-ssh "/usr/sbin/sshd -D" 18 hours ago Up 18 hours 0.0.0.0:32768->22/tcp my-first-docker[root@salt-master ~]# docker ps -lCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES31142aabc63c bceaae03d0ea "/bin/sh -c 'apt-get " 15 hours ago Exited (100) 15 hours ago drunk_borg[root@salt-master ~]# |
|
1
2
|
[root@salt-master ~]# docker ps -a |grep bceaae03d0ea31142aabc63c bceaae03d0ea "/bin/sh -c 'apt-get " 15 hours ago Exited (100) 15 hours ago drunk_borg |
|
1
2
3
4
5
6
7
8
9
10
11
12
|
[root@salt-master ~]# docker ps -aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES31142aabc63c bceaae03d0ea "/bin/sh -c 'apt-get " 15 hours ago Exited (100) 15 hours ago drunk_borgf8aa111d0066 centos6-ssh "/usr/sbin/sshd -D" 18 hours ago Up 18 hours 0.0.0.0:32768->22/tcp my-first-docker删除已经退出运行的容器[root@salt-master ~]# docker ps -a | grep "Exited" | awk '{print $1 }'|xargs docker rm31142aabc63c[root@salt-master ~]# [root@salt-master ~]# [root@salt-master ~]# docker ps -aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESf8aa111d0066 centos6-ssh "/usr/sbin/sshd -D" 18 hours ago Up 18 hours 0.0.0.0:32768->22/tcp my-first-docker |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
删除none镜像[root@salt-master ~]# docker images |grep none<none> <none> bceaae03d0ea 15 hours ago 172 MB[root@salt-master ~]# docker images |grep none |awk '{print $3}'bceaae03d0ea[root@salt-master ~]# docker images |grep none |awk '{print $3}'|xargs docker rmiDeleted: sha256:bceaae03d0ea6312608c6a9f310bcaa0b4363792fba6ee4875e1d2b9c7c1fbb1[root@salt-master ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE516249940/centos6-ssh v1 f6bb69ea7020 19 hours ago 556.4 MBcentos6-ssh latest f6bb69ea7020 19 hours ago 556.4 MBdocker.io/centos centos6 8315978ceaaa 4 weeks ago 194.6 MBdocker.io/ubuntu 12.10 3e314f95dcac 2 years ago 172 MB[root@salt-master ~]# |
本文介绍了解决Docker中无法删除<none>类型镜像的问题,包括定位问题原因、查找关联容器及成功删除的方法。
342

被折叠的 条评论
为什么被折叠?



