報錯:
[root@localhost /]# sudo docker pull ubuntu
Error response from daemon: Get https://registry-1.docker.io/v2/library/ubuntu/manifests/2.04: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fubuntu%3Apull&serviceregistry.docker.io: net/http: TLS handshake timeout
解決方式:
第1步:通過dig @114.114.114.114 registry-1.docker.io
找到可用IP地址
IP地址非固定可能會變動,所以需要多試幾次(幾個IP)
第二步:修改/etc/hosts
強制docker.io相關的域名解析到其它可用IP
第三步:保存配置文件后進行多次重試可以成功下載鏡像
第四步:驗證是否成功