bake: display read definition files in build output #2076
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If no bake definition are specified, it will currently consume the default ones in this specified order:
buildx/bake/bake.go
Lines 47 to 53 in 05b8821
Following-up a discussion with @milas:
So there is an issue with
compose-go
writing on stdout warnings: https://github.com/compose-spec/compose-go/blob/2d32c3f774bda0ad20e8d06eae493047b728fc54/template/template.go#L206. Didn't find an easy way to disable logging via https://github.com/compose-spec/compose-go/blob/2d32c3f774bda0ad20e8d06eae493047b728fc54/template/template.go#L114-L116 without settingoptions.Interpolate.Substitute
and redefining templating on our side. @milas @glours Is it possible to have smth easier to consume throughloader.Options
instead likeoptions.Logging = false
?It also appears in his case that consuming a
compose.yml
anddocker-bake.hcl
when invokingdocker buildx bake
is unexpected/confusing. Maybe we could put some effort and clearly state this behavior in our docs https://docs.docker.com/build/bake/reference/#file-format (cc @dvdksn).On the other hand it's pretty common to have a compose file just for runtime and a bake hcl file to build on a repository so I tend to agree with him.
This PR will show what bake definitions are consumed in the build output to mitigate this issue and help user figures out what is the source of the definition: