kslr
V2EX  ›  Docker

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

  •  
  •   kslr · Feb 27, 2018 · 3582 views
    This topic created in 3170 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
    kslr
    OP
    Feb 27, 2018
    1
    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
    zhoulouzi
    Feb 27, 2018
    2
    daemon.json
    {
    "insecure-registries": ["X"]
    }
    kslr
    kslr
    OP
    Feb 27, 2018
    3
    @zhoulouzi #2 没有正面解决的办法吗
    kslr
    kslr
    OP
    Feb 27, 2018
    5
    @hljjhb #4 ubuntu 但是根据文档环境变量也会在启动时加载才对,我使用的是小飞机
    hljjhb
    hljjhb
    Feb 28, 2018 via Android
    6
    @kslr 16.04+么

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