如何删除 Docker 的镜像? [英] How can I delete Docker's images?
本文介绍了如何删除 Docker 的镜像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下图片:
alex@alexvps:~$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
<none> <none> 70c0e19168cf 5 days ago 1.069 GB
<none> <none> c2ce80b62174 8 days ago 399.2 MB
<none> <none> 60afe4036d97 8 days ago 325.1 MB
当我尝试删除其中一个时,我得到:
and when I try to remove one of them I get:
alex@alexvps:~$ sudo docker rmi 60afe4036d97
Error: Conflict, 60afe4036d97 wasn't deleted
2014/01/28 00:54:00 Error: failed to remove one or more images
我怎样才能删除它们?为什么会有这样的冲突?
How can I remove them? Why is there such conflict?
推荐答案
要删除所有图片,使用给定的命令
docker rmi $(docker images -q)
要删除所有容器,请使用给定的命令
docker rm $(docker ps -a -q)
警告:这会破坏您的所有图像和容器.将无法恢复它们!
此解决方案由 Techoverflow.net.
这篇关于如何删除 Docker 的镜像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文