Skip to content

Conversation

daghack
Copy link
Contributor

@daghack daghack commented Jun 12, 2024

Update the lint subrequest call to error when a build error was encountered during linting.

When using the --call=check flag, buildx currently returns 0, even when there was a build error. This correctly updates that behavior and causes the build error to print its source, bringing the behavior in-line with --call=build.

Example

$ BUILDX_EXPERIMENTAL=1 docker buildx --builder=dev build -t trash --call=check . && echo "apple"
[+] Building 0.2s (2/2) FINISHED                                                                                                         docker-container:dev
 => [internal] connecting to local controller                                                                                                            0.0s
 => [internal] load build definition from Dockerfile                                                                                                     0.0s
 => => transferring dockerfile: 171B                                                                                                                     0.0s
FromAsCasing - https://docs.docker.com/go/dockerfile/rule/from-as-casing/
The 'as' keyword should match the case of the 'from' keyword
Dockerfile:7
--------------------
   5 |     COPY $app .
   6 |
   7 | >>> FROM scratch asgard third
   8 |
--------------------

ERROR: dockerfile parse error on line 7: FROM requires either one or three arguments
Dockerfile:7
--------------------
   5 |     COPY $app .
   6 |
   7 | >>> FROM scratch asgard third
   8 |
--------------------

@daghack daghack self-assigned this Jun 12, 2024
@daghack daghack requested a review from tonistiigi June 12, 2024 17:40
@daghack daghack marked this pull request as draft June 12, 2024 17:43
@daghack daghack force-pushed the handle-build-err-during-lint-request branch 2 times, most recently from e0d8b7d to a069f26 Compare June 13, 2024 15:48
@daghack daghack added this to the v0.14.1 milestone Jun 13, 2024
@daghack daghack force-pushed the handle-build-err-during-lint-request branch from a069f26 to c617b44 Compare June 13, 2024 16:01
@daghack daghack marked this pull request as ready for review June 13, 2024 16:16
@daghack daghack added the kind/bug Something isn't working label Jun 13, 2024
…ntered during linting

Signed-off-by: Talon Bowler <talon.bowler@docker.com>
@daghack daghack force-pushed the handle-build-err-during-lint-request branch from c617b44 to 927fb67 Compare June 13, 2024 16:47
@thompson-shaun thompson-shaun modified the milestones: v0.14.1, v0.15.1 Jun 13, 2024
…of the error

Signed-off-by: Talon Bowler <talon.bowler@docker.com>
@daghack
Copy link
Contributor Author

daghack commented Jun 14, 2024

@tonistiigi Can I get a merge here as well?

@tonistiigi tonistiigi merged commit 8ca18de into docker:master Jun 15, 2024
@daghack daghack deleted the handle-build-err-during-lint-request branch June 17, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants