From: Saj Goonatilleke Date: Wed, 18 Sep 2019 17:58:47 +0000 (+1000) Subject: FIX: Never prune Docker volumes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=70aaf454752acd79c86a864a1fbbc5a841064d2f;p=discourse_docker.git 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. --- 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