Docker 批量删除镜像

删除所有容器

docker rm `docker ps -a -q`

删除所有镜像

docker rmi `docker images -q`

按条件删除镜像

# 没有标签
docker rmi `docker images | awk '/^<none>/ { print $3 }'`

# 按名称
docker rmi --force `docker images | grep goharbor | awk '{print $3}'`

删除不干净,强制清空

systemctl stop docker
rm -rf /var/lib/docker
systemctl start docker

There are no comment yet.

HTML tag cannot be used in this comment.