delete all stopped containers docker code example
Example 1: remove stopped containers
$ docker rm $(docker ps -a -q)
Example 2: docker remove not running containers
docker container rm $(docker container ls –aq)
$ docker rm $(docker ps -a -q)
docker container rm $(docker container ls –aq)