version: "3"
services:
logging:
driver: json-file
options:
max-size: "200m" # 单个文件大小为200m 200k 2g
max-file: "10" # 最多10个文件
{
"log-driver":"json-file",
"log-opts": {"max-size":"20m", "max-file":"4"}
}
重启服务生效配置
sudo systemctl daemon-reload
sudo systemctl restart docker
/var/lib/docker/containers/