summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-04-24 12:45:00 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-04-24 12:56:24 +0200
commit145d74716c9cbc8d6c83be5a8f6a575543d10d06 (patch)
treefd406fddf0b282b50f58f3a6ed0384cbfa4f07b3 /cmd/podman
parenta1f73d095400f13999e61578567f338a9f13a008 (diff)
downloadpodman-145d74716c9cbc8d6c83be5a8f6a575543d10d06.tar.gz
podman-145d74716c9cbc8d6c83be5a8f6a575543d10d06.tar.bz2
podman-145d74716c9cbc8d6c83be5a8f6a575543d10d06.zip
podman: fix --http-proxy
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/common/specgen.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go
index e14fd78b4..9e8a271ae 100644
--- a/cmd/podman/common/specgen.go
+++ b/cmd/podman/common/specgen.go
@@ -288,7 +288,23 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string
if c.EnvHost {
env = envLib.Join(env, osEnv)
+ } else if c.HTTPProxy {
+ for _, envSpec := range []string{
+ "http_proxy",
+ "HTTP_PROXY",
+ "https_proxy",
+ "HTTPS_PROXY",
+ "ftp_proxy",
+ "FTP_PROXY",
+ "no_proxy",
+ "NO_PROXY",
+ } {
+ if v, ok := osEnv[envSpec]; ok {
+ env[envSpec] = v
+ }
+ }
}
+
// env-file overrides any previous variables
for _, f := range c.EnvFile {
fileEnv, err := envLib.ParseFile(f)