Fix file mode in image.save examples

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2018-11-08 17:32:33 -08:00
parent cebdee4aef
commit 852d79b08d
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ class ImageApiMixin(object):
Example: Example:
>>> image = cli.get_image("busybox:latest") >>> image = cli.get_image("busybox:latest")
>>> f = open('/tmp/busybox-latest.tar', 'w') >>> f = open('/tmp/busybox-latest.tar', 'wb')
>>> for chunk in image: >>> for chunk in image:
>>> f.write(chunk) >>> f.write(chunk)
>>> f.close() >>> f.close()

View File

@ -84,7 +84,7 @@ class Image(Model):
Example: Example:
>>> image = cli.get_image("busybox:latest") >>> image = cli.get_image("busybox:latest")
>>> f = open('/tmp/busybox-latest.tar', 'w') >>> f = open('/tmp/busybox-latest.tar', 'wb')
>>> for chunk in image: >>> for chunk in image:
>>> f.write(chunk) >>> f.write(chunk)
>>> f.close() >>> f.close()