安装docker时的一些问题1.如何添加代理2.无法连接docker deamon

最近用fuego框架安装docker时出现了一系列的问题
操作系统:ubuntu
工具:fuego

一。必须使用代理的环境,不能pull镜像文件
Trying to pull repository docker.io/library/
Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

需要指定代理,一共三个地方加代理
Bash的代理要大写,或者像docker代理那样大小写都加上

不过,Dockerfile里面的参数应该都是大写的

Apt代理 /etc/apt/apt.conf
Acquire::http::Proxy “http://yourproxyaddress:proxyport”;
Acquire::https::Proxy “http://yourproxyaddress:proxyport”;

Bash代理 ~/.bashrc
export HTTP_PROXY=http://proxyip:proxyport
export HTTPS_PROXY=http://proxyip:proxyport

Docker代理 /etc/sysconfig/docker
HTTP_PROXY=http://proxyip:proxyport
http_proxy= $HTTP_PROXY
HTTPS_PROXY= $HTTP_PROXY
https_proxy= $HTTP_PROXY
export HTTP_PROXY HTTPS_PROXY http_proxy https_proxy

不过,有很多源在国内无法访问,需要注意
可能涉及到更换源

二。无法连接docker deamon
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

因为docker 没有启动

启动:
service docker restart

不能连接docker也有可能是docker未安装或安装失败。
ubuntu安装docker时,可以使用 atp-get install docker.io
centos安装docker时,使用yum install docker

在不同系统中,软件包的名字也不一样

参考资料
https://blog.csdn.net/urms_handsomeyu/article/details/86653824
https://blog.csdn.net/weixin_43223076/article/details/83934578
https://blog.csdn.net/hunyxv/article/details/81458548
https://www.cnblogs.com/gomvc/p/11095152.html
https://blog.csdn.net/halcyonbaby/article/details/39475765

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值