Skip to content

Instantly share code, notes, and snippets.

@ntarocco
Last active August 31, 2021 17:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ntarocco/4725e27f7a196d9fe405574152b0e744 to your computer and use it in GitHub Desktop.
Save ntarocco/4725e27f7a196d9fe405574152b0e744 to your computer and use it in GitHub Desktop.
Stop and remove all docker containers
#!/usr/bin/env bash
docker stop $(docker ps -aq)
# docker container prune # Remove all stopped containers
# docker volume prune # Remove all unused volumes
# docker image prune # Remove unused images
# docker system prune # All of the above, in this order: containers, volumes, images
echo y | docker system prune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment