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

Add support for the docker /images/{}/get API endpoint #44

Merged
merged 2 commits into from
Jan 8, 2020

Conversation

Dieff
Copy link
Contributor

@Dieff Dieff commented Jan 7, 2020

I'm interested in writing Rust code to work with importing and exporting images, and creating them from scratch. I added a method to export images from the current daemon as TAR archives. Interested in adding image import functionality in the future.

This commit

  • Adds the Docker::export_image function, which calls the /images/{name}/get method of the API to return a TAR archive of image data. The new code is in /src/images/rs.
  • Adds a new test for Docker::export_image in tests/image_test.rs

Dieff added 2 commits January 7, 2020 16:12
When testing the ability to export images, was previously
loading the whole file into memory. This failed with the
much larger Windows images. Tests now export the image
to a temporary file, and then delete it after.
Copy link
Owner

@fussybeaver fussybeaver left a comment

Choose a reason for hiding this comment

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

LGTM, feel free to merge this when you're ready.

@Dieff
Copy link
Contributor Author

Dieff commented Jan 8, 2020

I don't have access to merge, but it's all set. I have another commit with image import functionality, but it changes the API a little bit so should probably be a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants