server
server copied to clipboard
Old images for bitwarden/setup are not removed by script
Steps To Reproduce
- Update bitwarden using
bitwarden.sh
- 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
@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
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.
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