mirror of https://github.com/docker/docker-py.git
added docs for get_image
This commit is contained in:
parent
22dd8d78ea
commit
cd0b648137
21
docs/api.md
21
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
|
**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
|
## history
|
||||||
|
|
||||||
Show the history of an image
|
Show the history of an image
|
||||||
|
@ -776,7 +796,6 @@ If `container` a dict, the `Id` key is used.
|
||||||
TODO:
|
TODO:
|
||||||
|
|
||||||
* events
|
* events
|
||||||
* get_image
|
|
||||||
* load_image
|
* load_image
|
||||||
* resize
|
* resize
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue