From fd1722591b05602ce30b9d5c7a49fc8ad8964e89 Mon Sep 17 00:00:00 2001 From: Giorgos Logiotatidis Date: Mon, 1 Jun 2015 20:21:53 +0300 Subject: [PATCH 1/2] Set default value for pull to False on build(). Fixes 622. --- docker/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/client.py b/docker/client.py index b6648067..f87e40ca 100644 --- a/docker/client.py +++ b/docker/client.py @@ -306,7 +306,7 @@ class Client(requests.Session): def build(self, path=None, tag=None, quiet=False, fileobj=None, nocache=False, rm=False, stream=False, timeout=None, - custom_context=False, encoding=None, pull=True, + custom_context=False, encoding=None, pull=False, forcerm=False, dockerfile=None, container_limits=None): remote = context = headers = None container_limits = container_limits or {} From 739d8758540c19c4d05c9378aed33244a6b9dac6 Mon Sep 17 00:00:00 2001 From: Giorgos Logiotatidis Date: Mon, 1 Jun 2015 20:22:46 +0300 Subject: [PATCH 2/2] Fix pull parameter for docker server version < 1.7. --- docker/client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker/client.py b/docker/client.py index f87e40ca..242f9553 100644 --- a/docker/client.py +++ b/docker/client.py @@ -352,6 +352,12 @@ class Client(requests.Session): 'dockerfile was only introduced in API version 1.17' ) + # Docker server 1.6 only supports values 1 and 0 for pull + # parameter. This was later fixed to support a wider range of + # values, including true / false. + # See also https://github.com/docker/docker/issues/13631 + pull = 1 if pull else 0 + u = self._url('/build') params = { 't': tag,