V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
kslr
V2EX  ›  Docker

docker private registry 设置代理的正确方式是什么呢?

  •  
  •   kslr · 2018-02-27 23:15:01 +08:00 · 2668 次点击
    这是一个创建于 2241 天前的主题,其中的信息可能已经有所发展或是发生改变。
    ➜  ~ env | grep proxy
    http_proxy=http://127.0.0.1:8118
    https_proxy=https://127.0.0.1:8118
    
     ~ cat /etc/default/docker
    # Docker Upstart and SysVinit configuration file
    
    #
    # THIS FILE DOES NOT APPLY TO SYSTEMD
    #
    #   Please see the documentation for "systemd drop-ins":
    #   https://docs.docker.com/engine/admin/systemd/
    #
    
    # If you need Docker to use an HTTP proxy, it can also be specified here.
    export http_proxy="http://127.0.0.1:8118/
    
    

    还是 Error response from daemon: Get https://registry.containers.ovh.net/v2/: net/http: TLS handshake timeout

    7 条回复    2018-02-28 11:59:20 +08:00
    kslr
        1
    kslr  
    OP
       2018-02-27 23:28:32 +08:00
    The Docker daemon uses the HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environmental variables in its start-up environment to configure HTTP or HTTPS proxy behavior. You cannot configure these environment variables using the daemon.json file.

    https://docs.docker.com/config/daemon/systemd/#httphttps-proxy
    真是要爆炸了
    zhoulouzi
        2
    zhoulouzi  
       2018-02-27 23:37:53 +08:00
    daemon.json
    {
    "insecure-registries": ["X"]
    }
    kslr
        3
    kslr  
    OP
       2018-02-27 23:41:13 +08:00
    @zhoulouzi #2 没有正面解决的办法吗
    hljjhb
        4
    hljjhb  
       2018-02-27 23:56:34 +08:00
    kslr
        5
    kslr  
    OP
       2018-02-27 23:58:54 +08:00
    @hljjhb #4 ubuntu 但是根据文档环境变量也会在启动时加载才对,我使用的是小飞机
    hljjhb
        6
    hljjhb  
       2018-02-28 11:55:41 +08:00 via Android
    @kslr 16.04+么

    看注释 systemd 不读取 /etc/default/docker
    kslr
        7
    kslr  
    OP
       2018-02-28 11:59:20 +08:00
    @hljjhb #6 考虑了一下如果所有软件都要这样设置的话成本太高了,决定试试透明代理。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5730 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 01:44 · PVG 09:44 · LAX 18:44 · JFK 21:44
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.