@@ -2,10 +2,13 @@ package builder
2
2
3
3
import (
4
4
"context"
5
+ "os"
6
+ "runtime"
5
7
"strings"
6
8
"sync"
7
9
8
10
"github.com/containerd/platforms"
11
+ "github.com/google/uuid"
9
12
"github.com/moby/buildkit/client/llb"
10
13
"github.com/moby/buildkit/client/llb/sourceresolver"
11
14
"github.com/moby/buildkit/frontend"
@@ -22,6 +25,7 @@ import (
22
25
"github.com/moby/buildkit/solver/errdefs"
23
26
"github.com/moby/buildkit/solver/pb"
24
27
"github.com/moby/buildkit/solver/result"
28
+ "github.com/moby/buildkit/util/appdefaults"
25
29
dockerspec "github.com/moby/docker-image-spec/specs-go/v1"
26
30
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
27
31
"github.com/pkg/errors"
@@ -59,6 +63,10 @@ func Build(ctx context.Context, c client.Client) (_ *client.Result, err error) {
59
63
}
60
64
return res , err
61
65
} else if ref , cmdline , loc , ok := parser .DetectSyntax (src .Data ); ok {
66
+ if runtime .GOOS == "windows" {
67
+ _ = os .Setenv ("FrontendGRPCPipe" , `\\.\pipe\buildkit-frontend-bridge` + uuid .NewString ())
68
+ ctx = context .WithValue (ctx , appdefaults .ContextKeyCustomFrontend , true )
69
+ }
62
70
res , err := forwardGateway (ctx , c , ref , cmdline )
63
71
if err != nil && len (errdefs .Sources (err )) == 0 {
64
72
return nil , wrapSource (err , src .SourceMap , loc )
0 commit comments