Added docker log rotation fix

This commit is contained in:
root 2024-11-22 16:06:53 +00:00
parent 69c23512c3
commit 2c81a8f4bd

View File

@ -1372,20 +1372,6 @@ check_docker() {
# Install Traefik certs dumper # Install Traefik certs dumper
curl -sfL https://raw.githubusercontent.com/ldez/traefik-certs-dumper/master/godownloader.sh | bash -s -- -b $(go env GOPATH 2>/dev/null)/bin v2.8.1 &> /dev/null curl -sfL https://raw.githubusercontent.com/ldez/traefik-certs-dumper/master/godownloader.sh | bash -s -- -b $(go env GOPATH 2>/dev/null)/bin v2.8.1 &> /dev/null
[ $? -ne 0 ] && failcheck "Couldn't install traefik certs dumper" [ $? -ne 0 ] && failcheck "Couldn't install traefik certs dumper"
fi
kill -9 $SPINPID &> /dev/null
echo -ne "done."
fi
if ! command -v docker-compose &> /dev/null; then
echo -ne "\n* Couldn't find docker-compose, installing.."
spin &
SPINPID=$!
# Install Docker compose on Ubuntu
if [ $OSRELEASE == "Ubuntu" ]; then
sudo apt-get install docker-compose -y &> /dev/null
fi
# Put in log rotation fix for docker container logs # Put in log rotation fix for docker container logs
cat > /etc/docker/daemon.json <<EOF cat > /etc/docker/daemon.json <<EOF
@ -1401,6 +1387,21 @@ EOF
# Restart docker daemon # Restart docker daemon
systemctl restart docker systemctl restart docker
fi
kill -9 $SPINPID &> /dev/null
echo -ne "done."
fi
if ! command -v docker-compose &> /dev/null; then
echo -ne "\n* Couldn't find docker-compose, installing.."
spin &
SPINPID=$!
# Install Docker compose on Ubuntu
if [ $OSRELEASE == "Ubuntu" ]; then
sudo apt-get install docker-compose -y &> /dev/null
fi
kill -9 $SPINPID &> /dev/null kill -9 $SPINPID &> /dev/null
echo -ne "done." echo -ne "done."
fi fi