To install docker-prune.sh copy it to your local bin folder: (If you need superuser rights preprend lines with sudo or su)
$ sudo -s
$ cp ./docker-prune.sh /bin
$ chmod +x /bin/docker-prune.sh
$ cd /bin
$ ln -s ./docker-prune.sh docker-prune
$ exit
$ docker-prune -c
$ docker-prune -s -c
$ docker-prune -i
If you wish to delete only stopped containers rather than running containers, miss the -s|--stop
flag.
$ docker-prune -a -s
Usage: docker-prune [Options]
Options:
-a|--all the same as -i -c
-i|--images prune dangling images
-c|--containers prune all stopped containers
-s|--stop stop running containers before pruning
© 2017 Informatikonline.net (Sebi2020)