You can use the below command to stop all containers running:
$ docker stop $(docker ps -a -q)
then you can remove all of the containers using this command:
$ docker rm $(docker ps -a -q)
If you want to remove all of the containers without stopping them, you can use th -f flag:
$ docker rm -f $(docker ps -a -q)
Hope this helped :)
Get trained by Docker veterans in online docker training course!