Skip to content
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

fix: check buildkit frontend version to determine context arg compatibility #486

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

miki725
Copy link
Collaborator

@miki725 miki725 commented Feb 11, 2025

Issue

Builds which specify frontend can sometimes fallback due to incompatible --build-arg

Description

Not all older frontends support --build-arg and sometimes they do no specify the version as part of the syntax directive. For example:

# syntax: docker/dockerfile:experimental

Chalk cannot infer anything about the meaning of experimental as its not pinned to any version. Therefore we call the dockerfile frontend container and check its actual version.
This is possibly not as efficient even if the version is specified however that would also require some heuristics. For example:

# syntax: docker/dockerfile:1

As 1 can change over time it might not be clear which syntax should actually be honored. Therefore it is probably a lot simpler to simply ask it what version it is instead of possibly error-prone version detection heuristics.

Testing

➜ maketest test_docker.py::test_build -x

…bility

Not all older frontends support `--build-arg` and sometimes they do no
specify the version as part of the syntax directive. For example:

```
syntax: docker/dockerfile:experimental
```

Chalk cannot infer anything about the meaning of `experimental`
as its not pinned to any version. Therefore we call the dockerfile
frontend container and check its actual version.
This is possibly not as efficient even if the version is specified
however that would also require some heuristics. For example:

```
syntax: docker/dockerfile:1
```

As `1` can change over time it might not be clear which syntax should
actually be honored. Therefore it is probably a lot simpler to simply
ask it what version it is instead of possibly error-prone version
detection heuristics.
@miki725
Copy link
Collaborator Author

miki725 commented Feb 11, 2025

@miki725 miki725 merged commit 746992c into main Feb 11, 2025
4 checks passed
@miki725 miki725 deleted the frontend branch February 11, 2025 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants