Skip to content

Cannot run docker build against a BuildKit instance with dockerfile.v0 frontend disabled #3077

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
3 tasks done
bentekkie opened this issue Mar 21, 2025 · 1 comment
Open
3 tasks done
Labels
good first issue Good for newcomers kind/enhancement New feature or request

Comments

@bentekkie
Copy link

Contributing guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

Running docker build --builder=someremote --build-arg BUILDKIT_SYNTAX=... against a BuildKit instance where the dockerfile.v0 frontend is disabled doesnt work

Expected behaviour

I expected that the docker image spec provided to BUILDKIT_SYNTAX would be used via the gateway.v0 frontend

Actual behaviour

ERROR: failed to solve: invalid frontend: dockerfile.v0

Buildx version

github.com/docker/buildx v0.9.1-docker ed00243

Docker info


Builders list

NAME/NODE           DRIVER/ENDPOINT                                                                       STATUS  BUILDKIT PLATFORMS
gv                  remote                                                                                                 
  gv0               unix://<redacted>/buildkitd.sock running v0.20.1  linux/amd64, linux/amd64/v2, linux/amd64/v3
stupefied_wright    docker-container                                                                                       
  stupefied_wright0 unix:///var/run/docker.sock                                                           stopped          
default *           docker                                                                                                 
  default           default                                                                               running 20.10.21 linux/amd64, linux/386

Configuration

N/A

Build logs


Additional info

No response

@UB2002
Copy link

UB2002 commented Apr 13, 2025

Hi @tonistiigi i have seen that you have added good first issue if possible can you help me on completing this task tell me what to do i will try to complete this I am new here

wnonnemaker added a commit to wnonnemaker/buildx that referenced this issue Apr 23, 2025
A user reported a bug where using BUILDKIT_SYNTAX option
with the build-arg flag set would throw an invalid frontend:
dockerfile.v0 error if using a Buildkit instance with the
frontend dockervile.vo option enabled set to false.

/build/opt.go did not contain any logic for handling the
BUILDKIT_SYNTAX option.

I am making this change because the docs suggest that the
BUILDKIT_SYNTAX option is equivalent to the #syntax directive one
could use in a dockerfile, but omitting the directive and keeping
BUILDKIT_SYNTAX did not lead to a succesful build.

Another bug that seems to be related is that if you use the #syntax
directive and try to build the dockerfile using a BuildKit instance
with dockerfile.v0 frontend disabled will not lead to a succesful build.

Resolves: docker#3077

Signed-off-by: Will Nonnemaker <wnonnemaker@gmail.com>
wnonnemaker added a commit to wnonnemaker/buildx that referenced this issue Apr 23, 2025
added logic to handle BUILDKIT_SYNTAX option with --build-arg

I am making this change because the docs suggest that the
BUILDKIT_SYNTAX option is equivalent to the #syntax directive one
could use in a dockerfile, but omitting the directive and keeping
BUILDKIT_SYNTAX currently does not lead to a succesful build.

Resolves: docker#3077

Signed-off-by: Will Nonnemaker <wnonnemaker@gmail.com>
wnonnemaker added a commit to wnonnemaker/buildx that referenced this issue Apr 23, 2025
added logic to handle BUILDKIT_SYNTAX option with --build-arg

I am making this change because the docs suggest that the
BUILDKIT_SYNTAX option is equivalent to the #syntax directive one
could use in a dockerfile, but omitting the directive and keeping
BUILDKIT_SYNTAX currently does not lead to a succesful build.

Resolves: docker#3077

Signed-off-by: Will Nonnemaker <wnonnemaker@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants