I am having this issue in my Mac system 10.11.6
system3:postgres saurabh-gupta2$ docker build -t postgres . Sending build context to Docker daemon 38.91kB Step
I had the following entries in my /etc/hosts file:
34.228.211.243 registry-1.docker.io 34.205.88.205 auth.docker.io 104.18.121.25 production.cloudflare.docker.com
Just by commenting them out, I fixed the problem.