|
17 | 17 | logging.getLogger("docker").setLevel(logging.INFO) |
18 | 18 |
|
19 | 19 | def getDockerHostFromContext(): |
20 | | - current_context_name_cmd = subprocess.run(["docker", "context", "show"], capture_output=True) |
21 | | - current_context_name = current_context_name_cmd.stdout.decode().replace("\n", "") |
22 | | - current_context_cmd = subprocess.run(["docker", "context", "inspect", current_context_name], capture_output=True) |
| 20 | + current_context_cmd = subprocess.run(["docker", "context", "inspect"], capture_output=True) |
23 | 21 | current_context_json = json.loads(current_context_cmd.stdout.decode()) |
24 | 22 | return current_context_json[0]["Endpoints"]["docker"]["Host"] |
25 | 23 |
|
@@ -70,7 +68,7 @@ def mainLoop(docker_host, listen_system_ports): |
70 | 68 | if __name__ == "__main__": |
71 | 69 | logging.info('Starting docker remote proxy!') |
72 | 70 | parser = argparse.ArgumentParser(description='Remote docker context proxy') |
73 | | - parser.add_argument('--listen-system-ports', action=argparse.BooleanOptionalAction, default=False, help='Listen and Proxy system ports example: 22, 80, 443 etc.!') |
| 71 | + parser.add_argument('--listen-system-ports', action='store_true', help='Listen and Proxy system ports example: 22, 80, 443 etc.!') |
74 | 72 | parser.add_argument('--host', type=str, default=None, help='Docker host uri') |
75 | 73 | args = parser.parse_args() |
76 | 74 | if DOCKER_HOST_ENV != None: |
|
0 commit comments