-
Notifications
You must be signed in to change notification settings - Fork 156
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
feat(buildkit): Expose envd as a buildkit frontend #194
Comments
If we move to the frontend design, we can integrate with buildkit ecosystem seamlessly. For example, we can use buildx action in GitHub:
|
Ref #510 |
Buildkit frontend requires a image from us, just like The image package main
func main() {
if err := grpcclient.RunFromEnvironment(appcontext.Context(), dockerfile.Build); err != nil {
logrus.Errorf("fatal error: %+v", err)
panic(err)
}
} It wraps the We can provide a similar implementation in package main
func main() {
if err := grpcclient.RunFromEnvironment(appcontext.Context(), envd.Build); err != nil {
logrus.Errorf("fatal error: %+v", err)
panic(err)
}
} And the build.envd can be:
We can use
The gateway in buildkit will forward requests to our own |
After #606 is merged, we already have the build func. But we cannot make envd a frontend of buildkit:
|
It seems we could leverage named context https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/ if we made envd a buildkit frontend, but we need to pass an extra argument to
|
The cache dir should be added by default in |
Please correct me if I missing something 🤔, we cannot access dir outside the build context dir during build time if envd is used as a buildkit frontend since buildx only adds the context dirs to |
Yep, we cannot access dirs if it is not added into buildkit as a build context. I mean we should keep localdir in LocalDirs by default in |
BTW, if you are interested in buildkit integration with envd, maybe you can have a look at #124 We are working on supporting debug functionality in envd, similar to docker buildx. But there are many challenges especially from buildkit. |
Mocker uses github.com/moby/buildkit/gateway/client instead of github.com/moby/buildkit/client.
It introduces a new abstraction Build func https://github.com/r2d4/mockerfile/blob/140c6a912bbfdae220febe59ab535ef0acba0e1f/pkg/build/build.go#L37
The benefit is that you can do some post-solve logic like this https://github.com/r2d4/mockerfile/blob/140c6a912bbfdae220febe59ab535ef0acba0e1f/pkg/build/build.go#L65
The text was updated successfully, but these errors were encountered: