Last active
August 29, 2015 14:22
-
-
Save iLoveTux/7ff9e625d439a32da4d1 to your computer and use it in GitHub Desktop.
Docker - One liner to remove all non-running containers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The following command will cycle through all containers and attempt to remove it. | |
# NOTE: This will fail on running containers (you will get an error message, but it | |
# will just move on to the next one) | |
$ sudo docker ps -a | grep -v CONTAINER | awk '{ print $1 }' | xargs -L 1 sudo docker rm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment