# vim /etc/docker/daemon.json
{
"log-driver":"json-file",
"log-opts": {"max-size":"500m", "max-file":"3"}
}
This configuration is only effective for new containers,
Alternatively, you can specify a limit log file when creating a container:
docker run -it --log-opt mode=non-blocking --log-opt max-buffer-size=4m alpine ping 127.0.0.1
Reference: https://docs.docker.com/config/containers/logging/configure/
Find command large files:
# 在当前文件夹下查找所有文件大小超过800 的文件
find . -type f -size +800M -print0 | xargs -0 ls -l