From 70aaf454752acd79c86a864a1fbbc5a841064d2f Mon Sep 17 00:00:00 2001 From: Saj Goonatilleke Date: Thu, 19 Sep 2019 03:58:47 +1000 Subject: [PATCH] FIX: Never prune Docker volumes `system prune` on older Docker releases will remove volumes. The accidental removal of container volumes may result in user data loss. This patch should ensure that any users on Docker CE <17.06.1 benefit from the same, safer behaviour enjoyed by users on contemporary Docker releases. --- launcher | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/launcher b/launcher index b94284f..7fb6ea9 100755 --- a/launcher +++ b/launcher @@ -235,7 +235,8 @@ check_prereqs() { echo if [[ $REPLY =~ ^[Yy]$ ]] then - $docker_path system prune -af + $docker_path container prune --force --filter until=1h >/dev/null + $docker_path image prune --all --force --filter until=1h >/dev/null echo "If the cleanup was successful, you may try again now" fi fi @@ -469,7 +470,8 @@ if [ -z $docker_path ]; then fi [ "$command" == "cleanup" ] && { - $docker_path system prune -a + $docker_path container prune --filter until=1h >/dev/null + $docker_path image prune --all --filter until=1h >/dev/null if [ -d /var/discourse/shared/standalone/postgres_data_old ]; then echo -- 2.25.1