我一直在研究ECR
。
我创建了一个终结点,以能够在不离开VPC的情况下拉入和推送docker
容器。
我的问题是我在代理后面
我的http-proxy.conf
看起来像这样
[Service]
Environment= "http_proxy=http://x.x.x.x:8080"
Environment= "https_proxy=http://x.x.x.x:8080"
Environment= "no_proxy=.dkr.ecr.us-west2.amazonaws.com"
由于某些原因,当我从
docker pull
内的一个容器中执行ECR
时,它的速度确实很慢,因为它使用的是proxy
而不是non-proxy
。如果我删除了前2行
http
和https
,它的速度确实很快。有任何想法吗?
最佳答案
您可以使用noProxy
为任何特定的URL启用*
根据 docker
man:
Configure Docker to use a proxy server | Docker Documentation
On the Docker client, create or edit the file
~/.docker/config.json
in the home directory of the user which starts containers. Add JSON such as the following, substituting the type of proxy withhttpsProxy
orftpProxy
if necessary, and substituting the address and port of the proxy server. You can configure multiple proxy servers at the same time.You can optionally exclude hosts or ranges from going through the proxy server by setting a
noProxy
key to one or more comma-separated IP addresses or hosts. Using the*
character as a wildcard is supported, as shown in this example.{ "proxies": { "default": { "httpProxy": "http://127.0.0.1:3001", "httpsProxy": "http://127.0.0.1:3001", "noProxy": "*.test.example.com,.example2.com" } } }
Save the file.
When you create or start new containers, the environment variables are set automatically within the container.
关于amazon-web-services - AWS ECR端点no_proxy问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61279660/