Browse Source

removed logic for excluding the setup image from being purged. all BW images will be removed when purging.

pull/440/head
gitclonebrian 1 week ago
parent
commit
f3ceda05ec
  1. 11
      run.ps1
  2. 12
      run.sh

11
run.ps1

@ -140,15 +140,8 @@ function Create-Dir($str) { @@ -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() { @@ -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
}
}

12
run.sh

@ -163,15 +163,7 @@ function createDir() { @@ -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() { @@ -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
}

Loading…
Cancel
Save