mirror of https://github.com/docker/docker-py.git
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.
This commit is contained in:
parent
2ac5cca84d
commit
732b4378ae
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue