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

Merged
merged 1 commit into from
Feb 12, 2025

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

@tonistiigi tonistiigi merged commit 2389d45 into docker:master Feb 12, 2025
127 checks passed
@crazy-max crazy-max deleted the ctn-driver-display-pull-error branch February 12, 2025 17:27
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
3 participants