Skip to content
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

docs: change image.history() return type to list (#3076) #3202

Merged
merged 3 commits into from
Jan 3, 2024

Conversation

Khushiyant
Copy link
Contributor

@Khushiyant Khushiyant commented Dec 17, 2023

Fix #3076
As mentioned in docs here, it should return str but it returns the history as list object

Currently:

history()
Show the history of an image.

Returns:
The history of the image.

Return type:
(str)

Raises:
docker.errors.APIError – If the server returns an error.

Update:

history()
Show the history of an image.

Returns:
The history of the image.

Return type:
(list)

Raises:
docker.errors.APIError – If the server returns an error.

For examples:

Basic alpine image return below history as list

[{'Comment': '', 'Created': 1701999570, 'CreatedBy': '/bin/sh -c #(nop) CMD ["/bin/sh"]', 'Id': 'sha256:<SHA>', 'Size': 0, 'Tags': ['alpine:latest']}, {'Comment': '', 'Created': 1701999570, 'CreatedBy': '/bin/sh -c #(nop) ADD file:<file> in / ', 'Id': '<missing>', 'Size': 7728526, 'Tags': None}]

@Khushiyant
Copy link
Contributor Author

@milas PTAL

Copy link
Contributor

@milas milas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@milas milas self-assigned this Jan 3, 2024
@milas milas enabled auto-merge (squash) January 3, 2024 18:25
@milas milas merged commit eeb9ea1 into docker:main Jan 3, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image.history() returned wrong type.
2 participants