1、新建/etc/docker/daemon.json:
vim /etc/docker/daemon.json
2、添加log-driver和log-opts:
{
"log-driver":"json-file",
"log-opts": {"max-size":"50m", "max-file":"3"}
}
3、重新加载配置,重启docker:
systemctl daemon-reload
systemctl restart docker
注意:本文归作者所有,未经作者允许,不得转载