Skip to content

Instantly share code, notes, and snippets.

@runlevel5
Created June 19, 2014 04:00
Show Gist options
  • Save runlevel5/2fbe9a976c4a6384d189 to your computer and use it in GitHub Desktop.
Save runlevel5/2fbe9a976c4a6384d189 to your computer and use it in GitHub Desktop.
Destroy exited docker containers
#!/bin/bash
CONTAINER_IDS=$(docker ps -a -q)
if [ -n "$CONTAINER_IDS" ]; then
docker stop $CONTAINER_IDS
docker rm $CONTAINER_IDS
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment