From cd0b648137e7eb32baacf482766a2c68bdaa17ec Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Wed, 11 Feb 2015 14:38:28 -0600 Subject: [PATCH] added docs for get_image --- docs/api.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/api.md b/docs/api.md index d9eebc0c..b77397a6 100644 --- a/docs/api.md +++ b/docs/api.md @@ -286,6 +286,26 @@ Export the contents of a filesystem as a tar archive to STDOUT **Returns** (str): The filesystem tar archive as a str +## get_image + +Get an image from the docker daemon. Similar to the `docker save` command. + +**Params**: + +* image (str): Image name to get + +**Returns** (urllib3.response.HTTPResponse object): The response from the docker daemon + +An example of how to get (save) an image to a file. +```python +>>> from docker import Client +>>> cli = Client(base_url='unix://var/run/docker.sock') +>>> image = cli.get_image(“fedora:latest”) +>>> image_tar = open(‘/tmp/fedora-latest.tar’,’w’) +>>> image_tar.write(image.data) +>>> image_tar.close() +``` + ## history Show the history of an image @@ -776,7 +796,6 @@ If `container` a dict, the `Id` key is used. TODO: * events -* get_image * load_image * resize