docker stop and remove all containers and images code example
Example 1: stop all container in docker
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
Example 2: docker remove all containers and images
docker container rm $(docker container ls -aq)
Example 3: docker remov all running containers
docker rm $(docker ps -aq)
Example 4: docker remove all containers and images
docker container stop $(docker container ls -aq)
Example 5: remove all containers docker
docker rmi $(docker images -q)