1、创建脚本文件
vi cleandocker.sh
内容如下:
#!/bin/sh echo "==================== start clean docker containers logs ==========================" logs=$(find /var/lib/docker/containers/ -name *-json.log) for log in $logs do echo "clean logs : $log" cat /dev/null > $log done echo "==================== end clean docker containers logs =========================="
2、给脚本文件授权
chmod 755 cleandocker.sh
3、执行脚本
./cleandocker.sh
docker /var/lib/docker/aufs/mnt 目录满了怎么清理
原文:https://www.cnblogs.com/areyouready/p/11002317.html