docker container ls --all --quiet | % {docker container rm --force $_ } code example
Example 1: remove all containers docker
docker rm $(docker ps -aq)
Example 2: remove all containers docker
docker rmi $(docker images -q)
docker rm $(docker ps -aq)
docker rmi $(docker images -q)