Skip to content

Instantly share code, notes, and snippets.

@sergiopvilar
Last active July 15, 2020 20:53
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 sergiopvilar/ced1576b40cd26c08ada25418411c4c4 to your computer and use it in GitHub Desktop.
Save sergiopvilar/ced1576b40cd26c08ada25418411c4c4 to your computer and use it in GitHub Desktop.
Aliases to stop docker containers and remove all images. Need to wipe all docker stuff? Run docker_purge
alias docker_cleanup_images="docker images | awk '{print $3}' | xargs docker rmi"
docker_cleanup() {
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
}
docker_purge() {
docker_cleanup
docker_cleanup_images
docker system prune --all --volumes -f
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment