From 24ffd2d6b95bdfab387cae3c92697d03a601cc08 Mon Sep 17 00:00:00 2001 From: Wolfgang Gerlach Date: Mon, 13 May 2019 16:48:06 -0500 Subject: [PATCH] pass proxy variables to container --- lib/worker/processor.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/worker/processor.go b/lib/worker/processor.go index 51050f7e..1c562730 100644 --- a/lib/worker/processor.go +++ b/lib/worker/processor.go @@ -561,6 +561,16 @@ func RunWorkunitDocker(workunit *core.Workunit) (pstats *core.WorkPerf, err erro logger.Debug(3, "HasPrivateEnv false") } + proxyVariables := [4]string{"HTTP_PROXY", "HTTPS_PROXY", "http_proxy", "https_proxy"} + for _, proxyVar := range proxyVariables { + proxyVarValue := os.Getenv(proxyVar) + if proxyVarValue != "" { + envPair := proxyVar + "=" + proxyVarValue + docker_environment = append(docker_environment, envPair) + docker_environment_string += " --env=" + envPair + } + } + stdout_file := path.Join(conf.DOCKER_WORK_DIR, conf.STDOUT_FILENAME) stderr_file := path.Join(conf.DOCKER_WORK_DIR, conf.STDERR_FILENAME)