Joined September 2018
·

dannotdaniel

·

Posted to Docker: remove all Exited containers over 1 year ago

This change is a little more bulletproof, though I am generally a huge fan of using grep and cut, but when you are doing something that removes containers explicit is good.

This will avoid inadvertently removing any containers which happen to have the word Exit in the name or command, and won't stop working if the output format of "docker ps -a" ever changes.

docker ps -a --filter status=exited --format {{.ID}} | xargs docker rm

Achievements
1 Karma
0 Total ProTip Views