Skip to content

Instantly share code, notes, and snippets.

@fredeerock
Last active May 19, 2020 04:05
Show Gist options
  • Save fredeerock/801095d8f314099218afabd1a80aaae1 to your computer and use it in GitHub Desktop.
Save fredeerock/801095d8f314099218afabd1a80aaae1 to your computer and use it in GitHub Desktop.
clean up docker

Stop all containers:

  • docker ps -aq | xargs docker stop

Remove all containers:

  • docker ps -aq | xargs docker rm

Remove all images:

  • docker images -aq | xargs docker rmi

Remove all networks:

  • docker network ls -q | xargs docker network rm

Remove all volumes:

  • docker volume ls -q | xargs docker volume rm

Remove all stopped containers, unused networks, dangling images, and build cache:

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