-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
Description
Is your feature request related to a problem?
Yes. Docker uses BuildKit under the hood. In order to establish a gRPC connection with BuildKit, we are supposed to send an HTTP POST request to a /grpc
REST endpoint with the following headers:
Connection: Upgrade
Upgrade: h2c
Here is the relevant code in the Docker codebase:
- https://github.com/docker/buildx/blob/f8de3c3bdcb956aa4b6671d36644c7af7a7989c5/driver/docker/driver.go#L60
- https://github.com/moby/moby/blob/3fc5bfd56569accf6129e5fcb4157349a1d0b79c/client/hijack.go#L43
- https://github.com/moby/moby/blob/3fc5bfd56569accf6129e5fcb4157349a1d0b79c/client/hijack.go#L55
Currently, NettyChannelBuilder.negotiationType(NegotiationType.PLAINTEXT_UPGRADE)
is hard-coded to use a context path of /
: https://github.com/grpc/grpc-java/blob/master/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java#L881
Describe the solution you'd like
Provide a way to specify which context path to apply PLAINTEXT_UPGRADE against.
Describe alternatives you've considered
Copy/paste the existing code into my own codebase, and manually change the hard-coded path.