Skip to content

Instantly share code, notes, and snippets.

@weblancaster
Last active May 25, 2020 12:53
Show Gist options
  • Star 34 You must be signed in to star a gist
  • Fork 14 You must be signed in to fork a gist
  • Save weblancaster/6e7f43fc02725ce747e224b0c4290906 to your computer and use it in GitHub Desktop.
Save weblancaster/6e7f43fc02725ce747e224b0c4290906 to your computer and use it in GitHub Desktop.
Kill all container, remove all images and stop all containers
#stop all containers:
docker kill $(docker ps -q)
#remove all containers
docker rm $(docker ps -a -q)
#remove all docker images
docker rmi $(docker images -q)
@moeiscool
Copy link

Thanks weblancaster! :D

but for those looking for a one liner!

docker kill $(docker ps -q) && docker rm $(docker ps -a -q) && docker rmi $(docker images -q)

@SirSerje
Copy link

thanks, helps a lot

@soniah
Copy link

soniah commented Jul 10, 2019

Also:

docker volume rm -f `docker volume ls -q`

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