Cleaning up after Docker right now is as easy as issuing
docker system prune
This works starting with version 1.25, you can read more here.
Previously, or if you prefer to have a bit more control, you could use the following:
$ docker rm -v $(docker ps -aq -f 'status=exited')
$ docker rmi $(docker images -aq -f 'dangling=true')
# ATTENTION: this will also remove volumes of docker-compose if the containers are barely stopped
$ docker volume rm $(docker volume ls -q -f 'dangling=true')
If you want more details about cleaning up after Docker, check out this article.