具体方法如下:
(推荐教程:docker教程)
1、停止所有的container,这样才能够删除其中的images:
docker stop $(docker ps -a -q)
如果想要删除所有container的话再加一个指令:
docker rm $(docker ps -a -q)
2、查看当前有些什么images
docker images
3、删除images,通过image的id来指定删除谁
docker rmi
想要删除untagged images,也就是那些id为
docker rmi $(docker images | grep "^" | awk "{print $3}")
要删除全部image的话
docker rmi $(docker images -q)
The above is the detailed content of How to delete docker image. For more information, please follow other related articles on the PHP Chinese website!