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)

sudo docker run hello-world

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'.

Modify docker mirror source:

docker default source for foreign official source, the download speed is slow, the country can be changed to accelerate

Option One

Modify or add /etc/docker/daemon.json

# We /etc/docker/daemon.json

{

"registry-mirrors": ["http://hub-mirror.c.163.com"]

}

systemctl restart docker.service

Option II

Modify or add / etc / sysconfig / docker, after the OPTIONS variable additional parameter --registry-mirror = https: //docker.mirrors.ustc.edu.cn

# vi /etc/sysconfig/docker

OPTIONS='--selinux-enabled --log-driver=journald --registry-mirror=https://docker.mirrors.ustc.edu.cn'

Docker domestic source Description ( Tip: You can try a few sources ):

Docker official in China

https://registry.docker-cn.com

Netease

http://hub-mirror.c.163.com

China University of Science and Technology

https://docker.mirrors.ustc.edu.cn

Ali Cloud

https://pee6w651.mirror.aliyuncs.com

I finally resolved with the following programs:

Enter / etc / docker

See if there daemon.json. This is the default configuration file docker.

If there is no new construction, if any, modifications.


[root@zengmg docker]# vi daemon.json
{
  "registry-mirrors": ["https://registry.docker-cn.com",“http://hub-mirror.c.163.com"]
}

Save and exit.


Restart docker Service

service docker restart

success!
 
---------------------

Content Reprinted from: https://blog.csdn.net/BigData_Mining/article/details/87869147

Guess you like

Origin www.cnblogs.com/qiao123/p/11267021.html