docker删除容器事变
docker删除容器出错,执行命令:
docker rmi f2a91732366c
错误信息:
Error response from daemon: conflict: unable to delete f2a91732366c (must be forced) - g used by stopped container 2522fde6d6da
解决方法:
docker rm - f f2a91732366c强制删除
然后再运行删除命令删除指定容器即可
有时候做练习的时候会生成大量的容器,一个一个停用然后删除实在太没有效率了。
1、停用全部运行中的容器: docker stop $(docker ps -q) 1 2、删除全部容器: docker rm $(docker ps -aq) 1 3、一条命令实现停用并删除容器: docker stop $(docker ps -q) & docker rm $(docker ps -aq)
Error response from daemon: conflict: unable to delete d8638d086558 (cannot be forced) - image has dependent child images
在删除镜像之前要先用 docker rm 删掉依赖于这个镜像的所有容器(哪怕是已经停止的容器),否则无法删除该镜像。
1.停止容器
# docker stop $(docker ps -a | grep "Exited" | awk '{print $1 }')
2.删除容器
# docker rm $(docker ps -a | grep "Exited" | awk '{print $1 }')
3.删除镜像
# docker rmi $(docker images | grep "none" | awk '{print $3}')
相关推荐
魅惑青花瓷 2020-11-11
yangkang 2020-11-09
MichaelJScofield 2020-11-06
TaoTaoFu 2020-11-06
liaochaowu 2020-11-16
ChlatZed 2020-11-11
lnkToKing 2020-10-29
ChlatZed 2020-10-27
ChlatZed 2020-10-13
时光流水 2020-09-23
yangkang 2020-09-23
changecan 2020-09-22
dusuanyun 2020-09-21
newisI 2020-09-01
liaochaowu 2020-09-14
ShangQuan0 2020-09-10
fearlessxjdx 2020-09-04
libra0 2020-09-02
ChlatZed 2020-08-23