From e4a3c8420793afaebaa49437ce9e9ad2f48b321e Mon Sep 17 00:00:00 2001 From: nono Date: Wed, 28 Jan 2026 20:31:09 +0000 Subject: [PATCH] Add update-docker.sh --- update-docker.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 update-docker.sh diff --git a/update-docker.sh b/update-docker.sh new file mode 100644 index 0000000..f5b1019 --- /dev/null +++ b/update-docker.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +echo "Starting system update and Docker maintenance..." + +# Update and upgrade APT packages +echo "Running apt update & upgrade..." +apt update +apt upgrade -y + +# Pull latest images, stop containers, and recreate in detached mode +echo "Pulling latest Docker images..." +docker compose pull + +echo "Stopping and removing existing containers..." +docker compose down + +echo "Starting containers in detached mode..." +docker compose up -d + +# Prune unused Docker objects +echo "Pruning unused Docker objects..." +docker system prune -a -f + +# Show running containers +echo "Current running Docker containers:" +docker ps + +echo "Maintenance complete." + +echo "Removing the file" +rm -f ./update-docker.sh + +echo "Done!"