aboutsummaryrefslogtreecommitdiff
path: root/tests/docker
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2017-03-06 17:55:20 -0300
committerFam Zheng <famz@redhat.com>2017-03-07 18:20:40 +0800
commit06cc3551714f2c9ee0d12f78a2ecd7e21b484fc8 (patch)
tree4810ff7ef04df6ad865fd0af3e0bc059be26045d /tests/docker
parenteba44e9339fc13c36e24c8c59e2b73ea231b46a1 (diff)
downloadqemu-06cc3551714f2c9ee0d12f78a2ecd7e21b484fc8.zip
qemu-06cc3551714f2c9ee0d12f78a2ecd7e21b484fc8.tar.gz
qemu-06cc3551714f2c9ee0d12f78a2ecd7e21b484fc8.tar.bz2
tests/docker: support proxy / corporate firewall
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é <f4bug@amsat.org> Message-Id: <20170306205520.32311-1-f4bug@amsat.org> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com>
Diffstat (limited to 'tests/docker')
-rwxr-xr-xtests/docker/docker.py6
1 files changed, 6 insertions, 0 deletions
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)