Skip to content

Instantly share code, notes, and snippets.

@nguyendung17
Created December 14, 2018 06:49
Show Gist options
  • Save nguyendung17/f9b2e40cf839a4d1e19206ceebe695f7 to your computer and use it in GitHub Desktop.
Save nguyendung17/f9b2e40cf839a4d1e19206ceebe695f7 to your computer and use it in GitHub Desktop.
Sometimes it's useful to start with a clean slate and remove all Docker containers and even images. Here are some handy shortcuts.
List all containers (only IDs)
docker ps -aq
Stop all running containers
docker stop $(docker ps -aq)
Remove all containers
docker rm $(docker ps -aq)
Remove all images
docker rmi $(docker images -q)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment