Skip to content
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #25 from mfournier/use-docker-volume
Browse files Browse the repository at this point in the history
use "docker volume" subcommand when using docker 1.9+
  • Loading branch information
mikljohansson committed May 24, 2016
2 parents 3657a3f + 3bf09da commit 2bcba27
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,17 @@ do
if [ $DEBUG ]; then echo DEBUG: Starting loop; fi

# Cleanup unused volumes
echo "=> Removing unused volumes"
/docker-cleanup-volumes.sh

if [[ $(docker version --format '{{(index .Server.Version)}}' | grep -E '^[01]\.[012345678]\.') ]]; then
echo "=> Removing unused volumes using 'docker-cleanup-volumes.sh' script"
/docker-cleanup-volumes.sh
else
echo "=> Removing unused volumes using native 'docker volume' command"
for volume in $(docker volume ls -qf dangling=true); do
echo "Deleting ${volume}"
docker volume rm "${volume}"
done
fi

IFS='
'
Expand Down

0 comments on commit 2bcba27

Please sign in to comment.