Skip to content

Commit

Permalink
Merge pull request #4 from franciscofsales/patch-1
Browse files Browse the repository at this point in the history
Removing unused docker volumes
  • Loading branch information
José Moreira authored Jan 24, 2018
2 parents a77d62f + fbc2a58 commit 6fdfe0a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ENV TUNE_TCP=1 \
ENV TUNE_DOCKER=1 \
docker_remove_containers=1 \
docker_remove_images=1 \
docker_remove_volumes=1 \
docker_loop_interval=21600

WORKDIR /tunesys
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ It has built-in configurable tuners that handles minor settings, such as:
* Docker
- Removes all images that are not being used. Option enable by default `docker_remove_images=1` in Dockerfile
- Removes all stoped containers. Option enable by default `docker_remove_containers=1` in Dockerfile.
- Removes all dangling volume. Option enable by default `docker_remove_volumes=1` in Dockerfile.


## Deploying
Expand Down
7 changes: 7 additions & 0 deletions tunesys/tuner/DOCKER
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ while true; do
docker images -q | xargs docker rmi

fi

if [ $docker_remove_volumes == "1" ]; then

echo "Removing unused docker volumes"
docker volume ls -qf dangling=true | xargs -r docker volume rm

fi

# Sleep
sleep $docker_loop_interval
Expand Down

0 comments on commit 6fdfe0a

Please sign in to comment.