Closed tonistiigi closed 1 day ago
Should call
be a block type in the bake file when defining subfields? And should it be possible to set control directives here?
# Short form
target "default" {
call = "check"
}
# Long form
target "default" {
call = {
method = "check"
format = "json"
error = true # ignorestatus / BUILDKIT_DOCKERFILE_CHECK=error=true
skip = [ "NoEmptyContinuation", "StageNameCasing" ] # BUILDKIT_DOCKERFILE_CHECK=skip=StageNameCasing,NoEmptyContinuations
}
}
Should
call
be a block type in the bake file when defining subfields?
Yes in the future we would like objects instead of csv values in HCL. This is tracked in https://github.com/docker/buildx/issues/438
Should call be a block type in the bake file when defining subfields? And should it be possible to set control directives here?
format=json
is for the whole output atm, so it can be set with --call
but in bake definition it is just a method name. Should there be multiple targets with different format, there is no way to print it as if user requests JSON we shouldn't print random text in the middle of the output.
ignorestatus
and #check=error=true
are not quite the same field as well. I'm not sure if ignorestatus
is even worth documenting atm.
:eyes: https://github.com/docker/buildx/actions/runs/9781238278/job/27004845569?pr=2556#step:7:468
=== FAIL: tests TestIntegration/TestBakeCallCheckFlag/worker=docker-container (4.20s)
bake.go:1086:
Error Trace: /src/tests/bake.go:1086
/src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:96
/src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:211
Error: Received unexpected error:
invalid character '/' after top-level value
Test: TestIntegration/TestBakeCallCheckFlag/worker=docker-container
--- FAIL: TestIntegration/TestBakeCallCheckFlag/worker=docker-container (4.20s)
Looks flaky
Will open a follow-up when #2562 is merged to add cross linking from bake to build
@crazy-max Something is printing to stdout on format=json
I think
Define call method in the bake target
Set call/check on all active targets
The text output of
call=outline
should be updated in follow-up to include bake definition and variables. Getting variables seems tricky and I think needs HCL parser updates.JSON output contains both Bake definition and the method result.
List all bake targets
List all bake variables