chore: layout changes
This commit is contained in:
parent
e615c1819e
commit
83091962a2
6 changed files with 78 additions and 15 deletions
31
container-update.sh
Normal file
31
container-update.sh
Normal file
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
for compose_file in /opt/docker/**/docker-compose.yml; do
|
||||
if [[ $(docker compose -f "$compose_file" ps -q) ]]; then
|
||||
echo "> Updating $compose_file"
|
||||
docker compose -f "$compose_file" pull
|
||||
docker compose -f "$compose_file" up -d --remove-orphans
|
||||
echo ""
|
||||
else
|
||||
echo "> Skipping $compose_file as it's not running."
|
||||
echo ""
|
||||
fi
|
||||
done
|
||||
|
||||
echo "> Containers have been updated."
|
||||
echo ""
|
||||
|
||||
confirm=n
|
||||
read -p "> Do you want to remove all dangling images? [y/N]" confirm
|
||||
echo ""
|
||||
|
||||
if [[ $confirm == [yY] ]]; then
|
||||
docker image prune -f -a
|
||||
echo "> All dangling images have been removed."
|
||||
else
|
||||
echo "> Dangling images haven't been removed."
|
||||
fi
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue