docker log size limit

Reference: https://blog.csdn.net/yjk13703623757/article/details/80283729?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task

# 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 

Guess you like

Origin www.cnblogs.com/qianxunman/p/12387521.html