Bootstrap FreeKB - Docker - Remove unused containers images volumes using the docker system prune command
Docker - Remove unused containers images volumes using the docker system prune command

Updated:   |  Docker articles

The docker system prune command can be used to

  • Remove all stopped containers
  • Remove all Docker networks not being used by any containers
  • Remove all images that are not being used by any containers
  • Remove all build cache
sudo docker system prune --all

 

The --volumes flag can be included to remove volumes that are not being used by any containers.

sudo docker system prune --all --volumes

 

By default, there will be a prompt asking you if you want to proceed. The -f or --force flag can be used to avoid the prompt and go foward with the removal.

sudo docker system prune --all --volumes --force

 

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 4af2ea in the box below so that we can be sure you are a human.