From 732b4378aef646ca808b653ee8e7e73f590ac33a Mon Sep 17 00:00:00 2001 From: Aanand Prasad Date: Tue, 14 Jan 2014 13:58:49 +0000 Subject: [PATCH] Configurable timeout on build(), defaults to None Many commands used in Dockerfiles hang for an extended period of time without producing any output, which will result in a socket timeout. Accordingly, it makes sense for build() to specify no timeout by default. --- docker/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/client.py b/docker/client.py index eb51ef84..3444a93b 100644 --- a/docker/client.py +++ b/docker/client.py @@ -308,7 +308,7 @@ class Client(requests.Session): u, None, params=self._attach_params(params), stream=True)) def build(self, path=None, tag=None, quiet=False, fileobj=None, - nocache=False, rm=False, stream=False): + nocache=False, rm=False, stream=False, timeout=None): remote = context = headers = None if path is None and fileobj is None: raise Exception("Either path or fileobj needs to be provided.") @@ -332,7 +332,7 @@ class Client(requests.Session): headers = {'Content-Type': 'application/tar'} response = self._post( - u, data=context, params=params, headers=headers, stream=stream + u, data=context, params=params, headers=headers, stream=stream, timeout=timeout ) if context is not None: