diff --git a/api/server/router/build/build_routes.go b/api/server/router/build/build_routes.go index 75e4c341e8..775ed55d7e 100644 --- a/api/server/router/build/build_routes.go +++ b/api/server/router/build/build_routes.go @@ -244,6 +244,10 @@ func (br *buildRouter) postBuild(ctx context.Context, w http.ResponseWriter, r * return progress.NewProgressReader(in, progressOutput, r.ContentLength, "Downloading context", buildOptions.RemoteContext) } + if buildOptions.Version == types.BuilderBuildKit && !br.daemon.HasExperimental() { + return errdefs.InvalidParameter(errors.New("buildkit is only supported with experimental mode")) + } + wantAux := versions.GreaterThanOrEqualTo(version, "1.30") imgID, err := br.backend.Build(ctx, backend.BuildConfig{ diff --git a/builder/builder-next/executor_windows.go b/builder/builder-next/executor_windows.go index 5071f6b1a4..7b0c6e64c8 100644 --- a/builder/builder-next/executor_windows.go +++ b/builder/builder-next/executor_windows.go @@ -1,11 +1,21 @@ package buildkit import ( + "context" "errors" + "io" + "github.com/moby/buildkit/cache" "github.com/moby/buildkit/executor" ) func newExecutor(_ string) (executor.Executor, error) { - return nil, errors.New("buildkit executor not implemented for windows") + return &winExecutor{}, nil +} + +type winExecutor struct { +} + +func (e *winExecutor) Exec(ctx context.Context, meta executor.Meta, rootfs cache.Mountable, mounts []executor.Mount, stdin io.ReadCloser, stdout, stderr io.WriteCloser) error { + return errors.New("buildkit executor not implemented for windows") }