Skip to content

Commit 14b9f67

Browse files
committed
Fix docker_openvino.py proxy when building
1 parent e87e65d commit 14b9f67

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

docker_openvino.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@
33
import argparse
44
import subprocess
55
import json
6+
import os
67

78
'''
89
This file is to provide limited support for older interface to run with old pipelines
910
'''
1011

12+
PROXY_ENV=["http_proxy", "https_proxy", "no_proxy"]
13+
PROXY_ENV=map(lambda x: (x, os.environ.get(x)), PROXY_ENV)
14+
PROXY_ENV=filter(lambda x: x[1], PROXY_ENV)
15+
PROXY_ENV=list(PROXY_ENV)
16+
17+
1118
parser = argparse.ArgumentParser()
1219
parser.add_argument("command")
1320
parser.add_argument("--package_url", "--package-url")
@@ -59,7 +66,9 @@ def log_run(command):
5966
if args.command == "all":
6067
log_run(["docker", "pull", image_info["base_image"]])
6168

62-
log_run(["docker", "build", ".", "-t", image_name])
69+
build_args_proxy = [f"--build-arg={k}={v}" for k, v in PROXY_ENV]
70+
71+
log_run(["docker", "build", ".", "-t", image_name, *build_args_proxy])
6372

6473
if args.command == "all":
6574
remote_name = f"{args.remote_repo}/{image_name}"

0 commit comments

Comments
 (0)