vm-setup/docker.sh
2024-01-02 14:19:56 +00:00

34 lines
616 B
Bash

#!/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
#docker
curl -fsSL https://get.docker.com -o get-docker.sh
sh ./get-docker.sh
rm get-docker.sh
#autoheal
docker run -d \
--name autoheal \
--restart=always \
-e AUTOHEAL_CONTAINER_LABEL=all \
-v /var/run/docker.sock:/var/run/docker.sock \
willfarrell/autoheal