Merge pull request #7720 from aiordache/context_bug

Pass context to docker cli
This commit is contained in:
Anca Iordache 2020-09-01 15:16:24 +02:00 committed by GitHub
commit 155eb91259
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1439,6 +1439,7 @@ def call_docker(args, dockeropts, environment):
key = dockeropts.get('--tlskey')
verify = dockeropts.get('--tlsverify')
host = dockeropts.get('--host')
context = dockeropts.get('--context')
tls_options = []
if tls:
tls_options.append('--tls')
@ -1454,6 +1455,10 @@ def call_docker(args, dockeropts, environment):
tls_options.extend(
['--host', re.sub(r'^https?://', 'tcp://', host.lstrip('='))]
)
if context:
tls_options.extend(
['--context', context]
)
args = [executable_path] + tls_options + args
log.debug(" ".join(map(pipes.quote, args)))