remove all the existing containers and images command in docker code example Example: remove all images docker docker rmi $(docker images -a -q)