docker automatically delete container code example
Example 1: remove all images docker
docker rmi $(docker images -a -q)
Example 2: docker remove all containers and images
docker container rm $(docker container ls -aq)
docker rmi $(docker images -a -q)
docker container rm $(docker container ls -aq)