There is similar problem if "docker login" fails (e.g. due to frequent outages of Docker Hub) - I would expect the build to stop immediately but it goes on with building.
[myproject] $ docker login -u myusername -e email@example.com -p ********
time="2015-05-20T06:01:23-04:00" level=fatal msg="Error response from daemon: </html> (Code: 500; Headers: map[Vary:[Cookie] X-Frame-Options:[SAMEORIGIN] Strict-Transport-Security:[max-age=31536000] Server:[nginx/1.6.2] Date:[Wed, 20 May 2015 10:01:22 GMT] Content-Type:[text/html; charset=utf-8]])"
[myproject] $ docker build -t mycompany/myproject:4d20ec41fd2bb0e5d6839e55511815ec9fe89c10 --pull=true .