Skip to content

Instantly share code, notes, and snippets.

@kidager
Last active April 29, 2019 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kidager/0fd6491510a7b9e359775e5e93f50ab8 to your computer and use it in GitHub Desktop.
Save kidager/0fd6491510a7b9e359775e5e93f50ab8 to your computer and use it in GitHub Desktop.
snippet.md

I have a helper function to nuke everything so that our Continuous blah, cycle can be tested, erm... continuously. Basically it boils down to the following:

To clear containers:

docker rm -f $(docker ps -a -q)

To clear images:

docker rmi -f $(docker images -a -q)

To clear volumes:

docker volume rm $(docker volume ls -q)

To clear networks:

docker network rm $(docker network ls | tail -n+2 | awk '{if($2 !~ /bridge|none|host/){ print $1 }}')

Taken from a github comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment