Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

docker: fix proxy env vars propagation #915

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions environment/container/docker/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,17 @@ func (d dockerRuntime) createDaemonFile(conf map[string]any, env map[string]stri
// add proxy vars if set
// according to https://docs.docker.com/config/daemon/systemd/#httphttps-proxy
if vars := d.proxyEnvVars(env); !vars.empty() {
proxyConf := map[string]any{}
if vars.http != "" {
conf["http-proxy"] = vars.http
proxyConf["http-proxy"] = vars.http
}
if vars.https != "" {
conf["https-proxy"] = vars.https
proxyConf["https-proxy"] = vars.https
}
if vars.no != "" {
conf["no-proxy"] = vars.https
proxyConf["no-proxy"] = vars.no
}
conf["proxies"] = proxyConf
}

b, err := json.MarshalIndent(conf, "", " ")
Expand Down