Home>Article>Operation and Maintenance> How to delete none image in docker
思路:
如果要删除镜像中的容器,那么先要删除镜像中的容器,而要删除镜像中的容器,则必须先停止容器。
具体步骤:
$ docker images $ docker rmi $(docker images | grep "none" | awk '{print $3}')
直接删除带none的镜像,直接报错了。提示先停止容器。
$ docker stop $(docker ps -a | grep "Exited" | awk '{print $1 }') //停止容器 $ docker rm $(docker ps -a | grep "Exited" | awk '{print $1 }') //删除容器 $ docker rmi $(docker images | grep "none" | awk '{print $3}') //删除镜像
相关推荐:docker教程
The above is the detailed content of How to delete none image in docker. For more information, please follow other related articles on the PHP Chinese website!