FEATURE: swap to using "docker system prune"
authorSam <sam.saffron@gmail.com>
Tue, 12 Feb 2019 10:04:30 +0000 (21:04 +1100)
committerSam <sam.saffron@gmail.com>
Wed, 13 Feb 2019 22:20:18 +0000 (09:20 +1100)
Stop using `docker gc` by spotify for image cleanup, instead use:
`docker system prune`

The new method is maintained by docker, old mechanism is no longer really
needed

launcher

index 5707727d2b54cfb568ea9e1fff746ded92ffd9da..bf7b9f1870e04c8475c8e6e522cea240a4cb63b2 100755 (executable)
--- a/launcher
+++ b/launcher
@@ -457,27 +457,7 @@ if [ -z $docker_path ]; then
 fi
 
 [ "$command" == "cleanup" ] && {
-  echo
-  echo "The following command will"
-  echo "- Delete all docker images for old containers"
-  echo "- Delete all stopped and orphan containers"
-  echo
-  read -p "Are you sure (Y/n): " -n 1 -r && echo
-  if [[ $REPLY =~ ^[Yy]$ || ! $REPLY ]]
-    then
-      space=$(df /var/lib/docker | awk '{ print $4 }' | grep -v Available)
-      echo "Starting Cleanup (bytes free $space)"
-
-      STATE_DIR=./.gc-state scripts/docker-gc
-
-      rm -f shared/standalone/log/var-log/*.txt
-
-      space=$(df /var/lib/docker | awk '{ print $4 }' | grep -v Available)
-      echo "Finished Cleanup (bytes free $space)"
-
-    else
-      exit 1
-  fi
+  $docker_path system prune -a
 
   if [ -d /var/discourse/shared/standalone/postgres_data_old ]; then
     echo