server icon indicating copy to clipboard operation
server copied to clipboard

Old images for bitwarden/setup are not removed by script

Open asesidaa opened this issue 3 years ago • 2 comments

Steps To Reproduce

  1. Update bitwarden using bitwarden.sh
  2. After upgrade, old images are removed, but the old bitwarden/setup images are not removed.

Expected Result

Old image of bitwarden/setup is also removed.

Actual Result

Old image of bitwarden/setup is not removed

Screenshots or Videos

No response

Additional Context

It seems that when removing old images, the bitwarden/setup images are filtered out, I wonder if the old images can be safely removed after upgrade.

Build Version

1.44.1

Environment

Self-Hosted

Environment Details

No response

asesidaa avatar Dec 12 '21 13:12 asesidaa

@joseph-flinn Do you have any thoughts as to why we don't remove the setup image? At a quick glance it seems the other containers are removed in the restart command, but since setup isn't included in the down it gets skipped.

https://github.com/bitwarden/server/blob/master/scripts/run.ps1#L81-L83

Hinton avatar Dec 14 '21 12:12 Hinton

Yes. We do this on purpose. Since setup is not an actively running container at the time this script is executing, I believe it was getting removed. Perhaps there is some other docker command we can use to be more smart about pruning older setup versions.

kspearrin avatar Feb 08 '22 04:02 kspearrin

I want to mention that as of the current version, the setup docker still is not pruned properly.

Suggestion (not sure if it's possible) is to maybe list all bitwarden/setup docker, sort on tags, and remove all of them except for the latest version?

Maybe using the docker system prune command? https://docs.docker.com/config/pruning/#prune-everything

Mindless999 avatar Nov 07 '23 15:11 Mindless999