From 7f48ed224259e1b4035fc005cb56b0a09e3f9e30 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Tue, 31 May 2022 18:42:55 -0400 Subject: [PATCH 1/2] fix: skip assets volume in cleandb script + add confirm prompt to cleanall --- docker/cleanall | 19 ++++++++++++------- docker/cleandb | 7 +++++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/docker/cleanall b/docker/cleanall index efe6f9f67e2..1cd9188a032 100755 --- a/docker/cleanall +++ b/docker/cleanall @@ -1,9 +1,14 @@ #!/bin/bash -cd .. -echo "Shutting down any instance still running and purge images..." -docker compose down -v --rmi all -echo "Purging dangling images..." -docker image prune -cd docker -echo "Done!" +read -p "Stop and remove all containers, volumes and images for this project? [y/N] " -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + cd .. + echo "Shutting down any instance still running and purge images..." + docker compose down -v --rmi all + echo "Purging dangling images..." + docker image prune + cd docker + echo "Done!" +fi diff --git a/docker/cleandb b/docker/cleandb index 4329a860142..f772ebce396 100755 --- a/docker/cleandb +++ b/docker/cleandb @@ -1,8 +1,11 @@ #!/bin/bash -echo "Shutting down any instance still running..." cd .. -docker compose down -v +echo "Shutting down any instance still running..." +docker compose down +echo "Removing DB volume..." +PROJNAME=$(basename $PWD) +docker volume rm -f "${PROJNAME}_mariadb-data" echo "Rebuilding the DB image..." docker compose pull db docker compose build --no-cache db From cd7c59b46468fefabba5e217f3638cec702dd262 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Fri, 3 Jun 2022 21:05:50 -0400 Subject: [PATCH 2/2] fix: remove purge dangling images from cleanall script --- docker/cleanall | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker/cleanall b/docker/cleanall index 1cd9188a032..91eac1764bf 100755 --- a/docker/cleanall +++ b/docker/cleanall @@ -7,8 +7,6 @@ then cd .. echo "Shutting down any instance still running and purge images..." docker compose down -v --rmi all - echo "Purging dangling images..." - docker image prune cd docker echo "Done!" fi