admin 管理员组

文章数量: 1087709

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

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

一。必须使用代理的环境,不能pull镜像文件
Trying to pull repository docker.io/library/
Get /: 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

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

参考资料



.html

本文标签: 安装docker时的一些问题1如何添加代理2无法连接docker deamon