From 3f00c059d459bbb79b6a3ddb04bccde3133bb176 Mon Sep 17 00:00:00 2001 From: Ben Whaley Date: Wed, 14 Aug 2013 16:48:54 -0700 Subject: [PATCH] Add nocache build option --- README.md | 2 +- docker/client.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 76734166..1cee7fbe 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ API Client class. `base_url` refers to the protocol+hostname+port where the docker server is hosted. Version is the version of the API the client will use. -* `c.build(path=None, tag=None, quiet=False, fileobj=None)` +* `c.build(path=None, tag=None, quiet=False, fileobj=None, nocache=False)` Similar to the `docker build` command. Either `path` or `fileobj` needs to be set. `path` can be a local path (to a directory containing a Dockerfile) or a remote URL. `fileobj` must be a readable file-like object to a Dockerfile. diff --git a/docker/client.py b/docker/client.py index 33c6db13..4411322c 100644 --- a/docker/client.py +++ b/docker/client.py @@ -213,7 +213,7 @@ class Client(requests.Session): else: break - def build(self, path=None, tag=None, quiet=False, fileobj=None): + def build(self, path=None, tag=None, quiet=False, fileobj=None, nocache=False): remote = context = headers = None if path is None and fileobj is None: raise Exception("Either path or fileobj needs to be provided.") @@ -227,7 +227,7 @@ class Client(requests.Session): context = self._tar(path) u = self._url('/build') - params = { 'tag': tag, 'remote': remote, 'q': quiet } + params = { 'tag': tag, 'remote': remote, 'q': quiet, 'nocache': nocache } if context is not None: headers = { 'Content-Type': 'application/tar' } res = self._result(self.post(u, context, params=params,