Skip to content

gateway: route dockerfile.v0 source to builtin frontend#6643

Open
crazy-max wants to merge 1 commit intomoby:masterfrom
crazy-max:gateway-builtin-syntax
Open

gateway: route dockerfile.v0 source to builtin frontend#6643
crazy-max wants to merge 1 commit intomoby:masterfrom
crazy-max:gateway-builtin-syntax

Conversation

@crazy-max
Copy link
Copy Markdown
Member

@crazy-max crazy-max commented Apr 1, 2026

alternative to and closes #6594

The gateway frontend now checks the forwarded source and short-circuits to the built-in Dockerfile frontend for the exact dockerfile.v0 selector.

@crazy-max crazy-max force-pushed the gateway-builtin-syntax branch 2 times, most recently from 7067599 to 75e48b4 Compare April 1, 2026 20:46
@crazy-max crazy-max requested a review from tonistiigi April 1, 2026 20:58
@crazy-max crazy-max added this to the v0.30.0 milestone Apr 1, 2026
@crazy-max crazy-max marked this pull request as ready for review April 1, 2026 20:58
return nil, errors.Errorf("no source specified for gateway")
}

if cmdline := strings.TrimSpace(opts["cmdline"]); cmdline == "dockerfile.v0" {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why is this checking cmdline instead of just source == "dockerfile.v0

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think cmdline is stricter than source. Buildx sets source to the first token of BUILDKIT_SYNTAX and keeps the original value in cmdline, so checking only source would also treat values like dockerfile.v0 foo as the builtin selector. I keyed it off strings.TrimSpace(cmdline) == "dockerfile.v0" to keep the special case limited to the exact selector and avoid changing behavior for malformed values. If you prefer source == "dockerfile.v0" for simplicity, I can switch it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The contract is that gateway will load whatever is in the source option. cmdline is just a way to pass arguments that are not parsed by buildkit itself. So I think we should only use source.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated

@crazy-max crazy-max force-pushed the gateway-builtin-syntax branch from 75e48b4 to cc113e9 Compare April 2, 2026 08:43
@crazy-max crazy-max requested a review from tonistiigi April 2, 2026 08:43
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max force-pushed the gateway-builtin-syntax branch from cc113e9 to 80b841c Compare April 2, 2026 09:07
@crazy-max crazy-max changed the title gateway: route dockerfile.v0 cmdline to builtin frontend gateway: route dockerfile.v0 source to builtin frontend Apr 2, 2026

var pred provenancetypes.ProvenancePredicateSLSA1
require.NoError(t, json.Unmarshal(dt, &pred))
require.Empty(t, pred.BuildDefinition.ExternalParameters.Request.Frontend)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is empty correct here? Shouldn't it be dockerfile.v0?

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.

2 participants