amazon-web-services - AWS ECR端点no_proxy问题

标签 amazon-web-services docker proxy docker-registry amazon-ecr

我一直在研究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行httphttps,它的速度确实很快。

有任何想法吗?

最佳答案

您可以使用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 with httpsProxy or ftpProxy 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/

相关文章:

amazon-web-services - 如何终止 AWS Opsworks 中的部署?

ubuntu - 错误 : The Docker Engine version is less than the minimum required by Compose

c# - 希望 WatiN 绕过 FireFox“需要身份验证”对话框

Symfony 2 Proxy 迭代替换 Symfony 1.4 项目

java - 为什么我在 ManyToOne 关联中看不到 Hibernate 代理对象?

php - 多个组织的系统设计

node.js - 是否建议将 Docker 与 AWS Elastic beanstalk 一起使用?

amazon-web-services - 为什么 Elastic Beanstalk 负载均衡器拒绝建立 SSL 连接?

Docker:有什么方法可以列出正在运行的 docker 容器中打开的套接字?

docker - 为两个docker容器设置相同的IP地址