kaisawind / Docker删除none镜像

Created Mon, 01 Jan 0001 00:00:00 +0000 Modified Wed, 24 Jul 2024 06:11:42 +0000
79 Words

Docker删除none镜像和Exited的容器

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}') //删除镜像