Docker is not working after installation

I’ve followed the steps given in the below link but docker is not working as expected (even hello world is not working).

Error found in my server is - 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)

But curl command for the url is not getting a timeout. So, there shouldn’t be any connectivity issue.

 [shoeb@localhost ~]$ uname -a
Linux localhost.localdomain 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[shoeb@localhost ~]$ docker -v
Docker version 19.03.5, build 633a0ea
[shoeb@localhost ~]$ systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since Sun 2020-01-05 23:50:43 +06; 1h 11min ago
     Docs: https://docs.docker.com
 Main PID: 7104 (dockerd)
    Tasks: 16
   Memory: 47.9M
   CGroup: /system.slice/docker.service
           └─7104 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/cont...

Jan 05 23:50:43 localhost.localdomain systemd[1]: Started Docker Application ...
Jan 05 23:50:48 localhost.localdomain dockerd[7104]: time="2020-01-05T23:50:4...
Jan 05 23:50:48 localhost.localdomain dockerd[7104]: time="2020-01-05T23:50:4...
Jan 05 23:50:48 localhost.localdomain dockerd[7104]: time="2020-01-05T23:50:4...
Jan 05 23:53:16 localhost.localdomain dockerd[7104]: time="2020-01-05T23:53:1...
Jan 05 23:53:16 localhost.localdomain dockerd[7104]: time="2020-01-05T23:53:1...
Jan 05 23:53:16 localhost.localdomain dockerd[7104]: time="2020-01-05T23:53:1...
Jan 06 00:59:32 localhost.localdomain dockerd[7104]: time="2020-01-06T00:59:3...
Jan 06 00:59:32 localhost.localdomain dockerd[7104]: time="2020-01-06T00:59:3...
Jan 06 00:59:32 localhost.localdomain dockerd[7104]: time="2020-01-06T00:59:3...
Hint: Some lines were ellipsized, use -l to show in full.
[shoeb@localhost ~]$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
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).
See 'docker run --help'.
[shoeb@localhost ~]$ curl https : // registry-1.docker.io/v2/
{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]}
[shoeb@localhost ~]$

Here is output of history command for installation and test-

4 sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
5 sudo yum install -y yum-utils device-mapper-persistent-data lvm2
6 sudo yum-config-manager --add-repo https : // download.docker. com/linux/centos/docker-ce.repo
7 sudo yum install docker-ce docker-ce-cli containerd. io
8 docker -v
9 groups
10*
11 docker run hello-world
12 sudo docker run hello-world
13 systemctl status docker
14 systemctl start docker
15 systemctl status docker
16 sudo docker run hello-world

Solved by setting proxy in /etc/systemd/system/docker.service.d/https-proxy.conf
[Service]
Environment=“HTTP_PROXY=http://proxy.example.com:80/
Environment=“HTTPS_PROXY=https://proxy.example.com:443/