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

feat: docker buildx context error #4401

Merged
merged 4 commits into from
Nov 4, 2023
Merged

feat: docker buildx context error #4401

merged 4 commits into from
Nov 4, 2023

Conversation

tcurdt
Copy link
Contributor

@tcurdt tcurdt commented Nov 2, 2023

Provide more context for the error message and point to the documentation.

It gives the users more context on the error and instructions to fix the problem.

Fixes the issue discussed in #4392

Sorry for the commit message formats. Read that too late.
I hope you can fix that using a "squash and merge"?

@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 2, 2023
@tcurdt
Copy link
Contributor Author

tcurdt commented Nov 2, 2023

It's a little weird. The message isn't quite what it should be though:

  ⨯ release failed after 1s                  error=docker build failed: failed to build tcurdt/foo:latest: exit status 1: ERROR: use `docker --context=default buildx` to switch to context "default"

Learn more at https://goreleaser.com/errors/docker-build

while the error is

docker buildx not set to default context
Please switch with 'docker context use default'
Learn more at https://goreleaser.com/errors/docker-build

Any idea why it's such a mixture?

@caarlos0
Copy link
Member

caarlos0 commented Nov 3, 2023

probably some other function is wrapping it, lemme clone your branch and take a look

Copy link
Member

@caarlos0 caarlos0 left a comment

Choose a reason for hiding this comment

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

the proposed changes fixed it to me:

  • docker images
    • building docker image                          image=goreleaser/goreleaser:v1.21.3-next-arm64
    • building docker image                          image=goreleaser/goreleaser:v1.21.3-next-amd64
    • took: 2s
  ⨯ release failed after 12s                 error=docker build failed: docker buildx not set to default context, please switch using 'docker context use default'
Learn more at https://goreleaser.com/errors/docker-build

internal/pipe/docker/docker.go Outdated Show resolved Hide resolved
internal/pipe/docker/docker.go Outdated Show resolved Hide resolved
@caarlos0
Copy link
Member

caarlos0 commented Nov 3, 2023

Sorry for the commit message formats. Read that too late.
I hope you can fix that using a "squash and merge"?

no problem! I usually squash merge PRs, so its all good :)

@caarlos0
Copy link
Member

caarlos0 commented Nov 3, 2023

also sorry for the delay, dunno what happened, I was debugging this, something happened, and I forgot it for 24hrs for some reason

tcurdt and others added 2 commits November 4, 2023 00:42
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@tcurdt
Copy link
Contributor Author

tcurdt commented Nov 3, 2023

also sorry for the delay, dunno what happened, I was debugging this, something happened, and I forgot it for 24hrs for some reason

No worries. Still much quicker than expected :)
Thanks for the review!

The changes made sense.
Hope it's ready for merge then.

Copy link

codecov bot commented Nov 4, 2023

Codecov Report

Merging #4401 (fc40375) into main (8cd3104) will decrease coverage by 0.02%.
Report is 13 commits behind head on main.
The diff coverage is 40.00%.

@@            Coverage Diff             @@
##             main    #4401      +/-   ##
==========================================
- Coverage   83.87%   83.85%   -0.02%     
==========================================
  Files         133      133              
  Lines       12727    12732       +5     
==========================================
+ Hits        10675    10677       +2     
- Misses       1635     1637       +2     
- Partials      417      418       +1     
Files Coverage Δ
internal/pipe/docker/docker.go 86.98% <40.00%> (-0.82%) ⬇️

@caarlos0 caarlos0 merged commit 1bd8190 into goreleaser:main Nov 4, 2023
8 of 12 checks passed
@github-actions github-actions bot added this to the v1.22.0 milestone Nov 4, 2023
@tcurdt tcurdt deleted the feature-docker-context-error branch November 4, 2023 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants