Added docker log rotation fix

This commit is contained in:
root 2024-11-22 16:03:12 +00:00
parent 213337cf3e
commit 69c23512c3

View File

@ -1387,6 +1387,20 @@ check_docker() {
sudo apt-get install docker-compose -y &> /dev/null sudo apt-get install docker-compose -y &> /dev/null
fi fi
# Put in log rotation fix for docker container logs
cat > /etc/docker/daemon.json <<EOF
{
"log-driver": "json-file",
"log-opts": {
"max-size": "200m",
"max-file": "3"
}
}
EOF
# Restart docker daemon
systemctl restart docker
kill -9 $SPINPID &> /dev/null kill -9 $SPINPID &> /dev/null
echo -ne "done." echo -ne "done."
fi fi