File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,26 @@ Export the contents of a filesystem as a tar archive to STDOUT
286
286
287
287
** Returns** (str): The filesystem tar archive as a str
288
288
289
+ ## get_image
290
+
291
+ Get an image from the docker daemon. Similar to the ` docker save ` command.
292
+
293
+ ** Params** :
294
+
295
+ * image (str): Image name to get
296
+
297
+ ** Returns** (urllib3.response.HTTPResponse object): The response from the docker daemon
298
+
299
+ An example of how to get (save) an image to a file.
300
+ ``` python
301
+ >> > from docker import Client
302
+ >> > cli = Client(base_url = ' unix://var/run/docker.sock' )
303
+ >> > image = cli.get_image(“fedora:latest”)
304
+ >> > image_tar = open (‘/ tmp/ fedora- latest.tar’,’w’)
305
+ >> > image_tar.write(image.data)
306
+ >> > image_tar.close()
307
+ ```
308
+
289
309
## history
290
310
291
311
Show the history of an image
@@ -778,7 +798,6 @@ If `container` a dict, the `Id` key is used.
778
798
TODO :
779
799
780
800
* events
781
- * get_image
782
801
* load_image
783
802
* resize
784
803
You can’t perform that action at this time.
0 commit comments