Error :Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection

docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).

I’m new to docker.I tried to install docker in my ubuntu 18.04 OS,it did get installed but when I tried to pull the hello-world image it threw the above error

Thanks in advance

Source: StackOverflow