I have been using ansible for building and deploying docker images for a while. Surprisingly I felt this is a really nice solution for leveraging docker, so I wrote an article about it, you can read it here:
http://victorlin.me/posts/2014/08/11/building-docker-image-with-ansible
Not only for building docker image, I think it’s also possible to build other kind of software with ansible. Anyway, just want to share some of thoughts, hope this could be helpful somehow.