Skip to content

Commit

Permalink
docker: fix proxy env vars propagation (#915)
Browse files Browse the repository at this point in the history
Co-authored-by: Michele D'Avino <[email protected]>
  • Loading branch information
mdavino and Michele D'Avino authored Dec 6, 2023
1 parent 814bca5 commit 79c49e7
Showing 1 changed file with 5 additions and 3 deletions.
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

0 comments on commit 79c49e7

Please sign in to comment.