Skip to content

Instantly share code, notes, and snippets.

@ValterAndrei
Last active August 18, 2023 18:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ValterAndrei/783241c817b52dca874b450346a53186 to your computer and use it in GitHub Desktop.
Save ValterAndrei/783241c817b52dca874b450346a53186 to your computer and use it in GitHub Desktop.
# Stop all containers
docker stop $(docker ps -qa)
# Remove all containers
docker rm $(docker ps -qa)
# Remove all images
docker rmi -f $(docker images -qa)
# Remove all volumes
docker volume rm $(docker volume ls -q)
# Remove all networks
docker network rm $(docker network ls -q)
# Your installation should now be all fresh and clean.
# The following commands should not output any items:
docker ps -a
docker images -a
docker volume ls
# The following command show only show the default networks:
docker network ls
docker system prune --all
# Inline
docker stop $(docker ps -qa); docker rm $(docker ps -qa); docker rmi -f $(docker images -qa); docker volume rm $(docker volume ls -q); docker network rm $(docker network ls -q)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment