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

failed to solve with frontend dockerfile.v0 when trying to use buildkit by a docker client in golang #2429

Closed
JasonChen233 opened this issue Oct 27, 2021 · 4 comments

Comments

@JasonChen233
Copy link

JasonChen233 commented Oct 27, 2021

I am trying to activate buildkit through a docker client in golang by setting the version field in ImageBuildOptions
Version: types.BuilderBuildKit
I get the following error info.Am I using the api wrong.Is there any Docs can help?
By the way, It seems that the response format is diffrerent. Where can I find the response format docs?
`...........
{"id":"moby.buildkit.trace","aux":"Cr0BCkdzaGEyNTY6YzhkN2FjMzYyNmFhYmYxZmY3NjkxYTBhZmQ4MmNiNTIzZTM4NTFhZDExMTNiOGUzNzViY2RmNmNlOTU1NWIxYhJHc2hhMjU2OjM5MzViNGMzZWU5ZDNkNjExMDZiZTc1YTliOTY1MmZkZGM4MDFmYjhlNDIzMTY2NzZlMTBjMjA2ZGJhNzFhOGQaD2NvcHkgL2NvbnRleHQgLyoLCNX844sGEMSKykQyCwjY/OOLBhDY7MJI"}
{"id":"moby.buildkit.trace","aux":"Co4BCkdzaGEyNTY6YWMwNzJkNTIxOTAxMjIyZWVlZjU1MGY1MjI4Mjg3N2YxOTZlMTZiMDI0Nzg0NGJlOWNlYjFjY2MxZWFjMzkxZBo2cmVzb2x2ZSBpbWFnZSBjb25maWcgZm9yIGRvY2tlci5pby9kb2NrZXIvZG9ja2VyZmlsZToxKgsI2PzjiwYQpJytfQ=="}
{"id":"moby.buildkit.trace","aux":"CrABCkdzaGEyNTY6YWMwNzJkNTIxOTAxMjIyZWVlZjU1MGY1MjI4Mjg3N2YxOTZlMTZiMDI0Nzg0NGJlOWNlYjFjY2MxZWFjMzkxZBo2cmVzb2x2ZSBpbWFnZSBjb25maWcgZm9yIGRvY2tlci5pby9kb2NrZXIvZG9ja2VyZmlsZToxKgsI2PzjiwYQpJytfTIMCNn844sGEOil9J4BOhJubyBhY3RpdmUgc2Vzc2lvbnM="}

{"errorDetail":{"message":"failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: no active sessions"},"error":"failed to solve with frontend dockerfile.v0: failed to solve with fron end gateway.v0: no active sessions"}
`

I am using docker on MAC
Client:
Cloud integration: 1.0.17
Version: 20.10.7
API version: 1.41
Go version: go1.16.4
Git commit: f0df350
Built: Wed Jun 2 11:56:22 2021
OS/Arch: darwin/amd64
Context: default
Experimental: true

Server: Docker Engine - Community
Engine:
Version: 20.10.7
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: b0f5bc3
Built: Wed Jun 2 11:54:58 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.6
GitCommit: d71fcd7d8303cbf684402823e425e9dd2e99285d
runc:
Version: 1.0.0-rc95
GitCommit: b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
docker-init:
Version: 0.19.0
GitCommit: de40ad0

And I had try all the following statement on the top of the Dockerfile
#syntax=docker/dockerfile:1
#syntax=docker/dockerfile:1.2
#syntax=docker/dockerfile:1.3

@JasonChen233 JasonChen233 changed the title failed to solve with frontend dockerfile.v0 when trying to failed to solve with frontend dockerfile.v0 when trying to use buildkit by a docker client in golang Oct 27, 2021
@JasonChen233
Copy link
Author

I Google the error info but mostly say that the dockerfile should be named Dockerfile instead of dockerfile. But I have named it Dockerfile

@tonistiigi
Copy link
Member

You need to dial a session connection as well to transfer local files.

Communication with buildkit should happen through grpc API. I wouldn't recommend to reverse engineer the HTTP connection. That code is being removed from docker cli as well docker/cli#3314

@JasonChen233
Copy link
Author

Oh I see. I read the code of runBuild,and found that to activate buildkit I should work like func runBuildBuildKit.A seesion is needed.
Thanks a lot, have a good day

@ting6688
Copy link

ting6688 commented Sep 9, 2024

Oh I see. I read the code of runBuild,and found that to activate buildkit I should work like func runBuildBuildKit.A seesion is needed. Thanks a lot, have a good day

so, How did you solve it? Thanks a lot!

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

No branches or pull requests

3 participants