Skip to content

Instantly share code, notes, and snippets.

@iLoveTux
Last active August 29, 2015 14:22
Show Gist options
  • Save iLoveTux/7ff9e625d439a32da4d1 to your computer and use it in GitHub Desktop.
Save iLoveTux/7ff9e625d439a32da4d1 to your computer and use it in GitHub Desktop.
Docker - One liner to remove all non-running containers
# 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