刪除所有關閉的容器
docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs docker rm
刪除所有dangling鏡像(即無tag的鏡像):
docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
刪除所有dangling數據卷(即無用的volume):
docker volume rm $(docker volume ls -qf dangling=true)
原文: https://hk.saowen.com/a/b901f1351c0d0450ca971a29335b89d5dd6c34f26e05a67163c7663c3b3deadb
data_api说: docker rmi $(docker images | grep "^<none>" | awk "{print $3}")