Skip to content

Instantly share code, notes, and snippets.

@s4mpl3d
Created February 16, 2019 05:04
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 s4mpl3d/f29873eb5f03abfd332e5554f386b398 to your computer and use it in GitHub Desktop.
Save s4mpl3d/f29873eb5f03abfd332e5554f386b398 to your computer and use it in GitHub Desktop.
delete all docker containers, images, networks and cache
#!/bin/bash
# stop all containers
docker stop $(docker ps -a -q)
# WARNING! This will remove:
# - all stopped containers
# - all networks not used by at least one container
# - all images without at least one container associated to them
# - all build cache
docker system prune -a -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment