From 7d62c79ab7606d99ba1db7e54a67d65aee055ddb Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sat, 11 Aug 2018 17:46:44 +0100 Subject: [PATCH] docker: redirect stderr to stdout for nicer exceptions. Unclear whether or not this is a hack, or whether it should be the default for more connection methods. When enabled, the exception text thrown when bootstrap fails includes the stderr text, which is apparently always useful. --- mitogen/docker.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mitogen/docker.py b/mitogen/docker.py index 38ee9d4e..36b0635b 100644 --- a/mitogen/docker.py +++ b/mitogen/docker.py @@ -43,6 +43,11 @@ class Stream(mitogen.parent.Stream): username = None docker_path = 'docker' + # TODO: better way of capturing errors such as "No such container." + create_child_args = { + 'merge_stdio': True + } + def construct(self, container=None, image=None, docker_path=None, username=None, **kwargs):