Open bickelj opened 2 months ago
A safer command that can leave at least one image assuming we built an image in the past 336 hours:
docker system prune -a --filter "until=336h"
Perhaps even safer:
[[ "$(docker ps | wc -l)" -eq "4" ]] && docker system prune -a --filter "until=336h"
In the test system over the weekend, the continuous integration script notified us of a couple failures. It turns out the disk was probably temporarily full. It is easy enough to run
docker system prune --all
when verifying that containers are up, but a more regular, targeted approach would be better because it is best to have the previous image present in case we need to roll back.