I was stumped for quite a while about why I couldn't get a docker build to run on my VM.  The symptom is that the docker build can not reach the outside world, and therefore can't pull in what it needs.  This happens even though the VM itself has no connectivity issues.  Note, I assume this is a VM thing because it happened to both mazz and myself, using Virtual Box fedora vms, but it may not be limited to VMs.   I finally stumbled on a stack overflow entry that solved the issue [1].

Basically, you need to tell docker about your DNS servers, and also Google's DNS server 8.8.8.8.  Your mileage may vary, perhaps you'll only need a subset of of servers, but hopefully this helps you out, because it was a pita.

[1] http://stackoverflow.com/questions/25130536/dockerfile-docker-build-cant-download-packages-centos-yum-debian-ubuntu-ap