docker容器中ubuntu apt-get Cannot initiate the connection to 61588:80 (0.0.240.148). - connect (22: Invalid argument)

Docker容器中ubuntu系统连不上外网

 

还是说说我遇到的情况  apt-get update  结果出现  E: Failed to fetch http://mirrors.ustc.edu.cn/ubuntu/dists/xenial-backports/restricted/source/Sources  Cannot initiate the connection to 61588:80 (0.0.240.148). - connect (22: Invalid argument)    

搜索很久无果 遂做个记录

很明显是连不上网  端口的问题   然后参考别人的博客

echo $http_proxy     结果是docker.for.mac.localhost:61588

然后我又pull了一个centos的源  跑起来之后发现yum完全没问题  

执行这个命令  echo $http_proxy   打印为空  

灵机一动把  输入命令 http_proxy=''

就好了   0.0   Exciting

 

 

 

参考  https://blog.csdn.net/chenxiancool/article/details/21225723

posted @ 2018-05-24 11:01  thebestrule  阅读(2215)  评论(0编辑  收藏  举报