Enable WCOW custom frontends to communicate with BuildKit via named pipe bridge #5868
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR adds support for custom frontends in WCOW by enabling gRPC communication from the container to the BuildKit in host machine via a named pipe.
Currently, the custom frontend bridge used anonymous pipes, which work well for Linux containers but are not supported in WCOW environments. As a result, custom frontends running in Windows containers were unable to communicate with the host machine's BuildKit instance.
This change:
\\.\pipe\buildkit-frontend-bridge
) specifically for WCOW custom frontend containers.Fixes #4892
Guide to test
STEP 1.
Compile frontend binary
You can use go code in this location: https://github.com/moby/buildkit/blob/master/frontend/dockerfile/cmd/dockerfile-frontend/main.go
use
go build -o ...
to createdockerfile-frontend.exe
STEP 2.
Build frontend image and push it your docker hub
The dockerfile contents to build the frontend image:
Can use this buildctl command to build frontend image
STEP 3.
Use the frontend image in your docker builds
say you have a dockerfile below, notice the use of #syntax to make use of your custom dockerfile frontend
yourdockerhuburl/dockerfrontend:latest
comes from the image you pushed in step 2