Docker cleanup

To see all containers adding the -a flag to "docker ps" will show all containers. 

docker ps -a

When you are sure you want to remove them all, first stop them all then remove them all

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

For final cleanup do this

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

WARNING! This will remove:
        - all stopped containers
        - all networks not used by at least one container
        - all volumes not used by at least one container
        - all images without at least one container associated to them
        - all build cache

Also for more info go here

https://medium.com/the-code-review/clean-out-your-docker-images-contain…
and
https://www.digitalocean.com/community/tutorials/how-to-remove-docker-i…