Solution
To list all containers with dockers (even the ones stopped) you can execute:
docker ps -a -q
We are going to use the output of the previous command to fetch docker stop
and docker rm
commands:
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)