-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix pulling images with stream=True
#2130
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
Conversation
Please sign your commits following these rules: $ git clone -b "i2116" git@github.com:adw1n/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. |
if not tag: | ||
repository, tag = parse_repository_tag(repository) | ||
|
||
kwargs['stream'] = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt that that the pull log can be big enough to cause memory issues.
stream=True
stream=True
Pulling an image with option `stream=True` like this: ``` client.api.pull('docker.io/user/repo_name', tag='latest', stream=True) ``` without consuming the generator oftentimes results in premature drop of the connection. Docker daemon tries to send progress of pulling the image to the client, but it encounters an error (broken pipe) and therefore cancells the pull action: ``` Thread 1 "dockerd-dev" received signal SIGPIPE, Broken pipe. ERRO[2018-09-03T05:12:35.746497638+02:00] Not continuing with pull after error: context canceled ``` As described in issue docker#2116, even though client receives response with status code 200, image is not pulled. Closes docker#2116 Signed-off-by: Przemysław Adamek <adw1n@users.noreply.github.com>
stream=True
stream=True
Hi @adw1n , thanks for the submission. I'm not sure that's the right approach. Forcing |
I only suggested forcing it in I do not force it in docker.api.image.pull
I agree about adding the documentation (I've done it in My suggestions for
or test if result of
|
@shin- ping |
Sorry this took longer than it should have! I've made a few updates and merged the code in #2186 . Thank you for your help and your patience! |
Pulling an image with option
stream=True
like this:without consuming the generator oftentimes results in premature drop of the connection. Docker daemon tries to send progress of pulling the image to the client, but it encounters an error (broken pipe) and therefore cancells the pull action:
As described in issue #2116, even though client receives response with status code 200, image is not pulled.
Closes #2116
Signed-off-by: Przemysław Adamek adw1n@users.noreply.github.com