diff options
author | Joffrey F <f.joffrey@gmail.com> | 2013-09-30 08:47:25 -0700 |
---|---|---|
committer | Joffrey F <f.joffrey@gmail.com> | 2013-09-30 08:47:25 -0700 |
commit | 3288e9f9b0dc99ba7f59b4bbfdc854be7c0219dc (patch) | |
tree | d5d98f9d56fec611f312eb2948ba63590a2f3516 | |
parent | 79beddda55383307404db3b9d6592ecffeff9984 (diff) | |
parent | 8c3900ecc5776424f1865ef0cf82a7e36add6c4f (diff) | |
download | docker-py-3288e9f9b0dc99ba7f59b4bbfdc854be7c0219dc.tar.gz |
Merge pull request #51 from webitup/master
Support the "-rm" parameter for the build method
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | docker/client.py | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -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, nocache=False)` +* `c.build(path=None, tag=None, quiet=False, fileobj=None, nocache=False, rm=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 9c0c0c4..03f383b 100644 --- a/docker/client.py +++ b/docker/client.py @@ -166,7 +166,7 @@ class Client(requests.Session): else: break - def build(self, path=None, tag=None, quiet=False, fileobj=None, nocache=False): + def build(self, path=None, tag=None, quiet=False, fileobj=None, nocache=False, rm=False): remote = context = headers = None if path is None and fileobj is None: raise Exception("Either path or fileobj needs to be provided.") @@ -180,7 +180,7 @@ class Client(requests.Session): context = utils.tar(path) u = self._url('/build') - params = { 't': tag, 'remote': remote, 'q': quiet, 'nocache': nocache } + params = { 't': tag, 'remote': remote, 'q': quiet, 'nocache': nocache, 'rm': rm } if context is not None: headers = { 'Content-Type': 'application/tar' } res = self._result(self.post(u, context, params=params, |