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

Disable compression by default when using container:get_archive method #2520

Merged
merged 1 commit into from Aug 7, 2020

Conversation

Nicceboy
Copy link
Contributor

Some pre-discussion can be found from here: moby/moby#40577

This PR attempts to disable compression by default and parametrize the encoding of data stream, when using container's get_archive method. This should bring similar performance than command docker cp has when copying files from container as tar file into host system.

Current implementation is not giving any headers for this GET request, and this causes the use of default headers of requests library: Accept-Encoding: gzip, deflate.

This makes Docker engine to encode response stream as gzip-compressed format, and this slows download speed a lot.

I'm not sure if giving possibility for parameter is that useful, but maybe there are some use cases where network bandwidth is bottleneck, and compression could be helpful.

@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "master" git@github.com:Nicceboy/docker-py.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

Signed-off-by: Niklas Saari <niklas.saari@tutanota.com>
@thaJeztah
Copy link
Member

Thanks! @ulyssessouza @shin- @ndeloof PTAL

@Nicceboy
Copy link
Contributor Author

Any updates about this?

@thaJeztah
Copy link
Member

ping @ulyssessouza

Copy link
Collaborator

@aiordache aiordache left a comment

Choose a reason for hiding this comment

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

LGTM!

@aiordache aiordache merged commit 6367bbe into docker:master Aug 7, 2020
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.

None yet

4 participants