[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 1/2] tests/docker: support proxy / corporate firewall
From: |
Fam Zheng |
Subject: |
[Qemu-devel] [PULL 1/2] tests/docker: support proxy / corporate firewall |
Date: |
Fri, 10 Mar 2017 15:20:50 +0800 |
From: Philippe Mathieu-Daudé <address@hidden>
if ftp_proxy/http_proxy/https_proxy standard environment variables available,
pass them to the docker daemon to build images.
this is required when building behind corporate proxy/firewall, but also help
when using local cache server (ie: apt/yum).
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
---
tests/docker/docker.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index 9fd32ab..8747f6a 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -28,6 +28,9 @@ from shutil import copy, rmtree
from pwd import getpwuid
+FILTERED_ENV_NAMES = ['ftp_proxy', 'http_proxy', 'https_proxy']
+
+
DEVNULL = open(os.devnull, 'wb')
@@ -272,6 +275,9 @@ class BuildCommand(SubCommand):
_copy_binary_with_libs(args.include_executable,
docker_dir)
+ argv += ["--build-arg=" + k.lower() + "=" + v
+ for k, v in os.environ.iteritems()
+ if k.lower() in FILTERED_ENV_NAMES]
dkr.build_image(tag, docker_dir, dockerfile,
quiet=args.quiet, user=args.user, argv=argv)
--
2.9.3