#17 add docker image cleanup script to extras

This commit is contained in:
jb
2017-05-23 17:07:36 +02:00
parent c19c46becd
commit f6b8be2c46
2 changed files with 27 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
[Dolphin]
Timestamp=2017,5,8,14,36,51
Version=4
ViewMode=1
[Settings]
HiddenFilesShown=true
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
#title :remove_docker_stopped_images.sh
#description :This script will remove all unused docker-images from the system.
# When issueing with "--force" it will also remove images which are
# in use. This will NOT remove the containers.
# Note: This script is very barebones and will produce errors
# by design.
#
#author :julian.bischof@metasfresh.com
#date :2017-04-03
#usage :./remove_docker_stopped_images.sh [--force]
#==============================================================================
docker rm $(docker ps -q -f status=exited) 2>&1 >/dev/null
docker rmi $1 `docker images | awk '{ print $3; }'` 2>&1 >/dev/null
exit 0