From 8825931deff4490bd3265192bf67e07352b879f0 Mon Sep 17 00:00:00 2001 From: Felix Schulze Date: Tue, 2 Jan 2024 14:58:39 +0000 Subject: [PATCH] Add docker-rocky.sh --- docker-rocky.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 docker-rocky.sh diff --git a/docker-rocky.sh b/docker-rocky.sh new file mode 100644 index 0000000..9082bd2 --- /dev/null +++ b/docker-rocky.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +cd /root + +#update script +cat >> update.sh << 'END' +#!/bin/bash + +cd /root +docker compose build --pull +docker compose pull +docker compose up --detach --force-recreate --build +docker image prune -f +docker system prune -f +END + +chmod +x update.sh +ln -s /root/update.sh /etc/cron.weekly/update_docker + +touch docker-compose.yml + +# install docker +dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo +dnf install -y docker-ce docker-compose-plugin +systemctl start docker +systemctl enable docker + +#autoheal +docker run -d \ + --name autoheal \ + --restart=always \ + -e AUTOHEAL_CONTAINER_LABEL=all \ + -v /var/run/docker.sock:/var/run/docker.sock \ + willfarrell/autoheal