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

docker-container: check error from response body when pulling image #2988

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

crazy-max
Copy link
Member

fixes moby/moby#49453

On ImageCreate we should check if the pull response body has an error.

_, err = io.Copy(io.Discard, rc)
return err
defer resp.Close()
return jsonmessage.DisplayJSONMessagesToStream(resp, streams.NewOut(io.Discard), nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

We can avoid the cli dependency:

Suggested change
return jsonmessage.DisplayJSONMessagesToStream(resp, streams.NewOut(io.Discard), nil)
return jsonmessage.DisplayJSONMessagesStream(resp, io.Discard, 0, false, nil)

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max force-pushed the ctn-driver-display-pull-error branch from 4f4757c to 3f82aad Compare February 12, 2025 11:35
@crazy-max crazy-max requested a review from vvoland February 12, 2025 11:36
Copy link
Contributor

@vvoland vvoland left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Buildx with new/unstarted docker-container driver and containerd can't use just pulled image
2 participants