@@ -144,7 +144,8 @@ def diff(self):
144
144
145
145
def exec_run (self , cmd , stdout = True , stderr = True , stdin = False , tty = False ,
146
146
privileged = False , user = '' , detach = False , stream = False ,
147
- socket = False , environment = None , workdir = None , demux = False ):
147
+ socket = False , environment = None , workdir = None , demux = False ,
148
+ use_config_proxy = False ):
148
149
"""
149
150
Run a command inside this container. Similar to
150
151
``docker exec``.
@@ -167,6 +168,10 @@ def exec_run(self, cmd, stdout=True, stderr=True, stdin=False, tty=False,
167
168
``{"PASSWORD": "xxx"}``.
168
169
workdir (str): Path to working directory for this exec session
169
170
demux (bool): Return stdout and stderr separately
171
+ use_config_proxy (bool): If ``True``, and if the docker client
172
+ configuration file (``~/.docker/config.json`` by default)
173
+ contains a proxy configuration, the corresponding environment
174
+ variables will be set in the command's environment.
170
175
171
176
Returns:
172
177
(ExecResult): A tuple of (exit_code, output)
@@ -185,7 +190,7 @@ def exec_run(self, cmd, stdout=True, stderr=True, stdin=False, tty=False,
185
190
resp = self .client .api .exec_create (
186
191
self .id , cmd , stdout = stdout , stderr = stderr , stdin = stdin , tty = tty ,
187
192
privileged = privileged , user = user , environment = environment ,
188
- workdir = workdir
193
+ workdir = workdir , use_config_proxy = use_config_proxy ,
189
194
)
190
195
exec_output = self .client .api .exec_start (
191
196
resp ['Id' ], detach = detach , tty = tty , stream = stream , socket = socket ,
0 commit comments