使用泊坞窗后面的一个EC2实例的代理实例、后面、泊坞窗

2023-09-11 23:38:50 作者:小小青年

我想要一个EC2虚拟机实例中运行泊坞窗。该实例的背后是一个HTTP代理。 据我可以告诉泊坞窗安装去好了。

I'm trying to run docker inside a EC2 VM instance. The instance is behind a http proxy. As far as I can tell the docker install went okay.

下面是实例信息

Linux ip-X-X-X-X 3.8.0-31-generic #46~precise1-Ubuntu SMP Wed Sep 11 18:21:16 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

泊坞窗版本,我已经是

The docker version I've is

Docker version 0.6.3, build b0a49a3

当我尝试运行它挂了很长一段时间的简单泊坞窗命令。

When I try to run a simple docker command it hangs for a long time.

$sudo docker run -i -t ubuntu /bin/bash
Unable to find image 'ubuntu' (tag: latest) locally
Pulling repository ubuntu

我有一种感觉,这已经是与我的HTTP代理设置。

I've a feeling that this has something to do with my HTTP proxy settings.

我尝试用不同的方式设置代理服务器。

I tried setting proxy in different ways.

例如基于这我试过,但它仍然无法正常工作。

For example based on this I tried but it still doesn't work.

$sudo HTTP_PROXY=http://proxy.xyz.com:8080 docker run -i -t ubuntu /bin/bash
Unable to find image 'ubuntu' (tag: latest) locally
Pulling repository ubuntu

知不知道我在这里丢失?

Any idea what am I missing here?

推荐答案

您需要运行的泊坞守护你HTTP_PROXY环境变量,因为图像的拉动功能就是通过后台程序。如果你在Ubuntu,这个可以通过修改来完成 /etc/init/docker.conf

You need to be running the Docker daemon with your HTTP_PROXY environment variable, since the pulling of images happens through the daemon. If you're on Ubuntu, this can be accomplished by modifying /etc/init/docker.conf.

更新:

我们也正确支持的/ etc /默认/泊坞窗现在,所以最好的办法,现在做到这一点(在Ubuntu和Debian)是通过出口HTTP_PROXY = ... 的/ etc /默认/泊坞窗

We also correctly support /etc/default/docker now, so the best way to accomplish this now (on Ubuntu and Debian) is via export http_proxy=... inside /etc/default/docker.