V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
kslr
V2EX  ›  Docker

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

  •  
  •   kslr · Feb 27, 2018 · 3192 views
    This topic created in 2989 days ago, the information mentioned may be changed or developed.
    ➜  ~ 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 replies    2018-02-28 11:59:20 +08:00
    kslr
        1
    kslr  
    OP
       Feb 27, 2018
    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  
       Feb 27, 2018
    daemon.json
    {
    "insecure-registries": ["X"]
    }
    kslr
        3
    kslr  
    OP
       Feb 27, 2018
    @zhoulouzi #2 没有正面解决的办法吗
    hljjhb
        4
    hljjhb  
       Feb 27, 2018
    kslr
        5
    kslr  
    OP
       Feb 27, 2018
    @hljjhb #4 ubuntu 但是根据文档环境变量也会在启动时加载才对,我使用的是小飞机
    hljjhb
        6
    hljjhb  
       Feb 28, 2018 via Android
    @kslr 16.04+么

    看注释 systemd 不读取 /etc/default/docker
    kslr
        7
    kslr  
    OP
       Feb 28, 2018
    @hljjhb #6 考虑了一下如果所有软件都要这样设置的话成本太高了,决定试试透明代理。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5796 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 06:44 · PVG 14:44 · LAX 23:44 · JFK 02:44
    ♥ Do have faith in what you're doing.