Tuesday, February 28, 2023

How to resolve Error response from daemon docker pull error

 In this video, I am going to show you the root cause of daemon docker pull error and how to resolve it in step by step demo. 


[root@ ~]# docker pull hello-world

Using default tag: latest

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)

Cause: The above error means that you have setup proxy on your local system and docker is unable to access docker registry through proxy.

Solution: The solution is to set proxy in docker's environment. Following are the steps:

Step 1: Create a drop-in directory 

mkdir /etc/systemd/system/docker.service.d

Step 2: Create a file with name /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable




Environment="NO_PROXY= URL,"

Step 3: Reload the systemd daemon

# systemctl daemon-reload

Step 4: Restart docker

# systemctl restart docker

Step 5: Verify that the configuration has been loaded

# systemctl show docker --property Environment

This should show the value of proxy variables which you set above. 

Step 6: Now run docker pull command again and it should work. 

No comments: