Skip to content

Instantly share code, notes, and snippets.

@ericmdev
Forked from JeffBelback/docker-destroy-all.sh
Last active October 20, 2021 09:15
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ericmdev/12ffea83f2dd867eb256 to your computer and use it in GitHub Desktop.
Save ericmdev/12ffea83f2dd867eb256 to your computer and use it in GitHub Desktop.
Docker - stop and remove all containers and images.
#!/bin/bash
# Stop all containers.
docker stop $(docker ps -a -q)
# Delete all containers.
docker rm $(docker ps -a -q)
# Delete all images.
docker rmi --force $(docker images -q)
@TendiF
Copy link

TendiF commented Nov 4, 2020

thanks

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