Hi,
I think I found a solution using Logrotate. I created the file /etc/logrotate.d/docker in which I added:
/var/lib/docker/containers//.log {
rotate 7
daily
compress
size=50M
missingok
delaycompress
copytruncate
}
Then I restarted Logrotate: sytemctl restart logrotate.service
There is another solution with the file /etc/docker/daemon.json which contains:
{
“log-driver”: “json-file”,
“log-opts”: {“max-size”: “10m”, “max-file”: “3”}
}
But this implies recreating the containers.