How to remove <none> images after building

docker rmi $(docker images -f dangling=true -q )

Removing the double quotes from the dangling options solves the problem