From 6f6e5aa9a13eb95beafd4a6fe34b5416d4c149a4 Mon Sep 17 00:00:00 2001 From: Josue Date: Wed, 14 Apr 2021 21:47:42 -0400 Subject: [PATCH] fix: change the orther in which clean up is done --- tools/autodeployment/deploy.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tools/autodeployment/deploy.sh b/tools/autodeployment/deploy.sh index 3c196bf054..8093b720b3 100755 --- a/tools/autodeployment/deploy.sh +++ b/tools/autodeployment/deploy.sh @@ -44,11 +44,9 @@ docker volume prune -f echo "Starting $ENV Environment" docker-compose --env-file $ENV_FILE --project-name=$ENV up -d -# Will fail on final container -# this is anticipated and doesn't affect new environment -echo "Deleting $OLD Containers" -docker rmi $(docker images $OLD\_* -aq ) -f 2> /dev/null - -# Delete all older containers which were build artifacts. -# On dev environment, this should reduce all usage by min ~20% -docker rmi $(docker images -a | grep "^" | awk '{print $3}') 2> /dev/null +echo "Removing dangling images" +docker rmi $(docker images -f "dangling=true" -q) + + +echo "Removing $OLD Environment" +docker rmi $(docker images $OLD\_* -aq ) -f 2> /dev/null