Command to remove all unused images

My main issue is dealing with orphan images.

docker rmi `docker images | awk '{ print $3; }'`

Does the trick… however it feels like I am playing with fire and it raises lots of errors.