From f3ceda05ec97c605aa30886544d95cd6d07c2978 Mon Sep 17 00:00:00 2001 From: gitclonebrian <235774926+gitclonebrian@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:04:15 -0500 Subject: [PATCH] removed logic for excluding the setup image from being purged. all BW images will be removed when purging. --- run.ps1 | 11 ++--------- run.sh | 12 ++---------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/run.ps1 b/run.ps1 index 64ec17e..a97cd36 100644 --- a/run.ps1 +++ b/run.ps1 @@ -140,15 +140,8 @@ function Create-Dir($str) { } } -function Docker-Prune([switch] $all) { - if ($all) { +function Docker-Prune { docker image prune --all --force --filter="label=com.bitwarden.product=bitwarden" - } - else { - docker image ls --format "{{.Repository}}:{{.Tag}}" --filter="label=com.bitwarden.product=bitwarden" | - Where-Object { $_ -notmatch '/bitwarden/setup' } | - ForEach-Object { docker image rm $_ } - } } function Update-Lets-Encrypt { @@ -226,7 +219,7 @@ function Uninstall() { $purgeAction = $( Read-Host "Would you like to purge all local Bitwarden container images (this will not remove third-party images such as certbot)? (y/n)" ) if ($purgeAction -eq "y") { - Docker-Prune -all + Docker-Prune } } diff --git a/run.sh b/run.sh index 78be224..f82b8f4 100755 --- a/run.sh +++ b/run.sh @@ -163,15 +163,7 @@ function createDir() { } function dockerPrune() { - if [ "$1" == 'all' ] - then - docker image prune --all --force --filter="label=com.bitwarden.product=bitwarden" - else - for image in $(docker image ls --format "{{.Repository}}:{{.Tag}}" --filter="label=com.bitwarden.product=bitwarden" | grep -v '/bitwarden/setup'); do - docker image rm "$image" - done - fi - + docker image prune --all --force --filter="label=com.bitwarden.product=bitwarden" } function updateLetsEncrypt() { @@ -285,7 +277,7 @@ function uninstall() { read PURGE_ACTION if [ "$PURGE_ACTION" == "y" ] then - dockerPrune all + dockerPrune echo -e -n "${CYAN}Bitwarden uninstall complete! ${NC}" fi }