在代理后面运行Boot2docker,获取FATA禁止与Docker中心的任何交互

时间:2015-05-29 17:17:34

标签: docker boot2docker

关注instruction to set up proxy of boot2docker,获取以下FATA,任何线索

尝试拉图片时

FATA[0020] Get https://index.docker.io/v1/repositories/library/busybox/images: Forbidden

FATA[0020] Error response from daemon: Server Error: Post https://index.docker.io/v1/users/: Forbidden  while trying to login

FATA[0000] Error response from daemon: Get https://index.docker.io/v1/search?q=ubuntu: Forbidden - 搜索图片时

已更新为包含curl -v https://index.docker.io:443

的结果
* Rebuilt URL to: https://index.docker.io:443/
* About to connect() to proxy 34363bd0dd54 port 8099 (#0)
* Trying 192.168.59.3...
* Adding handle: conn: 0x9adbad8
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x9adbad8) send_pipe: 1, recv_pipe: 0
* Connected to 34363bd0dd54 (192.168.59.3) port 8099 (#0)
* Establish HTTP proxy tunnel to index.docker.io:443
> CONNECT index.docker.io:443 HTTP/1.1
> Host: index.docker.io:443
> User-Agent: curl/7.33.0
> Proxy-Connection: Keep-Alive
> 
< HTTP/1.1 403 Forbidden
< Server: squid/3.4.9
< Mime-Version: 1.0
< Date: Fri, 29 May 2015 17:56:22 GMT
< Content-Type: text/html
< Content-Length: 3151
< X-Squid-Error: ERR_ACCESS_DENIED 0
< Vary: Accept-Language
< Content-Language: en
< X-Cache: MISS from localhost
< Via: 1.1 localhost (squid/3.4.9)
< Connection: keep-alive
< 
* Received HTTP code 403 from proxy after CONNECT
* Connection #0 to host 34363bd0dd54 left intact
curl: (56) Received HTTP code 403 from proxy after CONNECT

看起来这是代理问题,我在主机上运行代理服务器,通过它访问它s host name in boot2docker VM 's http_proxy and https_proxy but curl host_proxy:port`无问题地工作

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,在尝试从get.docker.com安装lxc-docker时会出现403错误(由于无法完成apt-get update而失败。在我的情况下,我有以下设置:

  • VM提供商: VirtualBox(Ubuntu 14.04(Trusty))
  • 环境: Vagrant
  • 供应商: chef-zero(通过Vagrant)
  • PROXY:起初我已经忘记了这一点,但我在我的主机(我的Macbook Pro)上运行apt-cacher-ng,以便在我使用时将数据下载降至最低。在Vagrant VM上运行apt-get install。简而言之,apt-cacher-ng在我的Mac上为Ubuntu VM设置了一个适当的镜像来从中提取包。

我意识到apt-cacher-ng不支持SSL存储库(https),但确实支持普通的http存储库。由于Docker存储库使用https,我必须找到一种解决方法。

在我修复任何内容之前,我在我的Ubuntu VM中的/etc/apt/apt.conf.d/10mirror文件中有以下内容(localip是运行apt-cacher-ng服务器的Mac的IP地址):

Acquire::http { Proxy "http://#{localip}:3142"; };

以上行意味着我的Ubuntu VM通过apt-cacher-ng获取包,但是当存储库使用https时失败。通过在该行下面添加以下行,事情开始正常工作:

Acquire::https { Proxy \false"; };

此时,/etc/apt/apt.conf.d/10mirror的内容如下:

Acquire::http { Proxy "http://#{localip}:3142"; };

Acquire::https { Proxy \false"; };

现在,运行apt-get update然后Docker成功安装,我恢复正常测试。如果您使用Vagrant设置10mirror文件,以下是我在Vagrantfile中执行此任务的行:

&#13;
&#13;
oak.vm.provision "shell", inline: "echo 'Acquire::http { Proxy \"http://#{localip}:3142\"; };' > /etc/apt/apt.conf.d/10mirror"
oak.vm.provision "shell", inline: "echo 'Acquire::https { Proxy \"false\"; };' >> /etc/apt/apt.conf.d/10mirror";
&#13;
&#13;
&#13;