WARNING:
By default, volumes are not removed to prevent important data from being deleted if there is currently no container using the volume. Use the
--volumes
flag when running the command to prune volumes as well:
Docker now has a single command to do that:
docker system prune -a --volumes
See the Docker system prune
docs