Skip to content

Add BUILDKIT_SYNTAX option handling #3157

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wnonnemaker
Copy link

This fix allows building with a remote builder where frontend.dockerfile.v0 enabled = false in the buildkitd yaml file.

Note that this change only allows the usage of BUILDKIT_SYNTAX with a custom frontend image, and using the #syntax directive in this case will still fail.

Resolves: #3077

This fix allows building with a remote builder where
frontend.dockerfile.v0 enabled = false in the buildkitd yaml file.

Note that this change only allows the usage of BUILDKIT_SYNTAX with
a custom frontend image, and using the #syntax directive in this case
will still fail.

Resolves: docker#3077

Signed-off-by: Will Nonnemaker <wnonnemaker@gmail.com>
@wnonnemaker
Copy link
Author

wnonnemaker commented Apr 24, 2025

This is my first pull request on this project, so any tips/guidance is much appreciated.

I didn't write any unit tests for this feature, so if you want me to do that, let me know. The only way I tested this feature is by reproducing and fixing the bug locally, which I understand isn't best practice.

While looking into this, I noticed a related bug where using the #syntax directive in a dockerfile will not be properly recognized if the BuildKit instance has
dockerfile.v0 disabled. If you want me to look more into this bug I am happy to do that as well.

Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

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

Look at the forwardGateway in https://github.com/moby/buildkit/blob/master/frontend/dockerfile/builder/build.go#L55-L56 . There is another parameter cmdline as well that allows passing extra args to the external frontend.

Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

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

^

@wnonnemaker
Copy link
Author

^

on it chief

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.

Cannot run docker build against a BuildKit instance with dockerfile.v0 frontend disabled
2 participants