Skip to content

Fix images low-level documentation examples #2799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docker/api/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_image(self, image, chunk_size=DEFAULT_DATA_CHUNK_SIZE):

Example:

>>> image = cli.get_image("busybox:latest")
>>> image = client.api.get_image("busybox:latest")
>>> f = open('/tmp/busybox-latest.tar', 'wb')
>>> for chunk in image:
>>> f.write(chunk)
Expand Down Expand Up @@ -379,7 +379,7 @@ def pull(self, repository, tag=None, stream=False, auth_config=None,

Example:

>>> for line in cli.pull('busybox', stream=True, decode=True):
>>> for line in client.api.pull('busybox', stream=True, decode=True):
... print(json.dumps(line, indent=4))
{
"status": "Pulling image (latest) from busybox",
Expand Down Expand Up @@ -458,7 +458,7 @@ def push(self, repository, tag=None, stream=False, auth_config=None,
If the server returns an error.

Example:
>>> for line in cli.push('yourname/app', stream=True, decode=True):
>>> for line in client.api.push('yourname/app', stream=True, decode=True):
... print(line)
{'status': 'Pushing repository yourname/app (1 tags)'}
{'status': 'Pushing','progressDetail': {}, 'id': '511136ea3c5a'}
Expand Down Expand Up @@ -549,7 +549,7 @@ def tag(self, image, repository, tag=None, force=False):

Example:

>>> client.tag('ubuntu', 'localhost:5000/ubuntu', 'latest',
>>> client.api.tag('ubuntu', 'localhost:5000/ubuntu', 'latest',
force=True)
"""
params = {
Expand Down