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

Image.history() returned wrong type. #3076

Closed
tuna2134 opened this issue Dec 11, 2022 · 1 comment · Fixed by #3202
Closed

Image.history() returned wrong type. #3076

tuna2134 opened this issue Dec 11, 2022 · 1 comment · Fixed by #3202

Comments

@tuna2134
Copy link

At the document, image.history() return str type, but it return list type.

@Khushiyant
Copy link
Contributor

Yes, as mentioned in docs here, it should return str but it returns the history as list object

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.

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 added a commit to Khushiyant/docker-py that referenced this issue Dec 17, 2023
Signed-off-by: Khushiyant <khushiyant2002@gmail.com>
milas pushed a commit that referenced this issue Jan 3, 2024
Fixes #3076.

Signed-off-by: Khushiyant <khushiyant2002@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants