Skip to content

Commit cff5ca0

Browse files
tnguyen14diemol
authored andcommitted
Allow proxy env variables to be set/inherited (#874)
1 parent bb31b6d commit cff5ca0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
NAMESPACE = os.environ.get('NAMESPACE')
1818
VERSION = os.environ.get('VERSION')
1919
USE_RANDOM_USER_ID = os.environ.get('USE_RANDOM_USER_ID')
20+
http_proxy = os.environ.get('http_proxy', '')
21+
https_proxy = os.environ.get('https_proxy', '')
22+
no_proxy = os.environ.get('no_proxy', '')
2023

2124
IMAGE_NAME_MAP = {
2225
# Hub
@@ -100,6 +103,11 @@ def launch_container(container, **kwargs):
100103
logger.info("Running %s container..." % container)
101104
container_id = client.containers.run("%s/%s:%s" % (NAMESPACE, IMAGE_NAME_MAP[container], VERSION),
102105
detach=True,
106+
environment={
107+
'http_proxy': http_proxy,
108+
'https_proxy': https_proxy,
109+
'no_proxy': no_proxy
110+
},
103111
**kwargs).short_id
104112
logger.info("%s up and running" % container)
105113
return container_id

0 commit comments

Comments
 (0)