1.删除悬空的镜像
docker image prune -a -f
2.删除悬空的镜像
docker container prune -f
3.定时清空镜像和脚本
[root@VM_0_42_centos opt]# cat clean.sh sh /opt/docker/lock.sh -t clean -a lock docker image prune -a -f docker container prune -f sh /opt/docker/lock.sh -t clean -a unlock dt=$(date) echo time is $dt
参考:https://blog.csdn.net/Java_1710/article/details/97752370