当前位置:   article > 正文

Ubuntu16.04下Docker pull connection refused 解决办法_docker pull connect: connection refused

docker pull connect: connection refused

检查Ubuntu是否设置了DNS,确保解析正常

Ubuntu DNS配置方法

interfaces方式
修改/etc/network/interfaces,配置DNS需要在该文件中加入

dns-nameserver xx.xx.xx.xx
dns-nameserver xxx.xxx.xx.xx
dns-nameservers xxx.xxx.xxx.xxx xxx.xxx.xx.xxx
  • 1
  • 2
  • 3

•dns-nameserver: 指定一条DNS地址,如果需要指定多个DNS则需要使用添加多行。
•dns-nameservers: 指定多个DNS地址,用空格隔开。
需要重启电脑方可生效

resolvconf方式
修改DNS则是通过修改/etc/resolvconf/resolv.conf.d/base,在文件中加入

nameserver xxx.xxx.xx.xxx
nameserver xx.xx.xx.xx
  • 1
  • 2

•nameserver: 指定DNS地址,当有多个DNS记录时每个DNS记录占一行。

sudo resolvconf -u      #更新/etc/resolv.conf文件
  • 1

Ubuntu 更换国内源

在天朝用外国的网址总是经历重重磨难,这里将国外源换为国内源,参考https://blog.csdn.net/shana_8/article/details/81482950
备份原来的源

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak1
  • 1

更换源为阿里源

sudo gedit /etc/apt/sources.list

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe
multiverse
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

更新源

sudo apt-get update
  • 1

这时候你会发现docker pull正常了~

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/寸_铁/article/detail/939072
推荐阅读
相关标签
  

闽ICP备14008679号