- 批量删除镜像和容器
docker rmi $(docker images -f "dangling=true" -q)
docker ps -a | xargs docker rm
- 删除无用中间镜像
sudo docker ps -a | grep "Exited" | awk '{print $1 }'|xargs sudo docker stop
sudo docker ps -a | grep "Exited" | awk '{print $1 }'|xargs sudo docker rm
sudo docker images|grep none|awk '{print $3 }'|xargs sudo docker rmi
- 以docker root 进入容器
docker exec -it --user root <container id> /bin/bash
- 查看docker 容器耗费资源
docker stats [<ContainerName>]