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

2018-02-27 23:15:01 +08:00
 kslr
➜  ~ 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

2777 次点击
所在节点    Docker
7 条回复
kslr
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
2018-02-27 23:37:53 +08:00
daemon.json
{
"insecure-registries": ["X"]
}
kslr
2018-02-27 23:41:13 +08:00
@zhoulouzi #2 没有正面解决的办法吗
hljjhb
2018-02-27 23:56:34 +08:00
kslr
2018-02-27 23:58:54 +08:00
@hljjhb #4 ubuntu 但是根据文档环境变量也会在启动时加载才对,我使用的是小飞机
hljjhb
2018-02-28 11:55:41 +08:00
@kslr 16.04+么

看注释 systemd 不读取 /etc/default/docker
kslr
2018-02-28 11:59:20 +08:00
@hljjhb #6 考虑了一下如果所有软件都要这样设置的话成本太高了,决定试试透明代理。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/433309

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX