docker 操作命令汇集

清除方法

sudo docker system prune -a
  • 删除docker 的image、container、volume

参考: 
https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes

I have found a work-around in the meantime. It’s a little tedious, but it clears up space on my Ubuntu 16.04 VM. Essentially… performing a “double-tap” on the system. Running as root or any system sudoer:

docker rm $(docker ps -a -q)
docker rmi --force $(docker images -q)
docker system prune --force

# Double-tap
systemctl stop docker
rm -rf /var/lib/docker/aufs
apt-get autoclean
apt-get autoremove
systemctl start docker
  •  

Make sure you’re not cd’d into your /var/lib/docker/aufs directory when running these commands. 
It did work for me running inside /var/lib/docker/. 
Just for sanity’s sake, check your docker service with sudo systemctl docker status 
verify the /var/lib/docker/aufs directory is empty with ls /var/lib/docker/aufs/. 
If nothing returns, it has been emptied! 
Lastly, check your system’s storage space with df. Happy times!

参考:https://github.com/moby/moby/issues/21925

阅读更多

扫码向博主提问

giserinchina

非学,无以致疑;非问,无以广识
  • 擅长领域:
  • java
  • 区块链
  • spring
去开通我的Chat快问
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wxb880114/article/details/81592090
个人分类: docker
上一篇Mac Vagrant box Mesos 集群管理搭建
下一篇使用Mesos和Marathon管理Docker集群
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭