Browse Source

Pass context to docker cli

Signed-off-by: aiordache <[email protected]>
aiordache 5 years ago
parent
commit
134319c735
1 changed files with 5 additions and 0 deletions
  1. 5 0
      compose/cli/main.py

+ 5 - 0
compose/cli/main.py

@@ -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)))