diff --git a/builder/builder-next/controller.go b/builder/builder-next/controller.go index 9116065d0c..616086804b 100644 --- a/builder/builder-next/controller.go +++ b/builder/builder-next/controller.go @@ -15,7 +15,6 @@ import ( "github.com/moby/buildkit/cache/metadata" "github.com/moby/buildkit/cache/remotecache" "github.com/moby/buildkit/control" - "github.com/moby/buildkit/executor/runcexecutor" "github.com/moby/buildkit/exporter" "github.com/moby/buildkit/frontend" "github.com/moby/buildkit/frontend/dockerfile" @@ -89,10 +88,7 @@ func newController(rt http.RoundTripper, opt Opt) (*control.Controller, error) { return nil, err } - exec, err := runcexecutor.New(runcexecutor.Opt{ - Root: filepath.Join(root, "executor"), - CommandCandidates: []string{"docker-runc", "runc"}, - }) + exec, err := newExecutor(root) if err != nil { return nil, err } diff --git a/builder/builder-next/executor_unix.go b/builder/builder-next/executor_unix.go new file mode 100644 index 0000000000..da54473dd1 --- /dev/null +++ b/builder/builder-next/executor_unix.go @@ -0,0 +1,17 @@ +// +build !windows + +package buildkit + +import ( + "path/filepath" + + "github.com/moby/buildkit/executor" + "github.com/moby/buildkit/executor/runcexecutor" +) + +func newExecutor(root string) (executor.Executor, error) { + return runcexecutor.New(runcexecutor.Opt{ + Root: filepath.Join(root, "executor"), + CommandCandidates: []string{"docker-runc", "runc"}, + }) +} diff --git a/builder/builder-next/executor_windows.go b/builder/builder-next/executor_windows.go new file mode 100644 index 0000000000..5071f6b1a4 --- /dev/null +++ b/builder/builder-next/executor_windows.go @@ -0,0 +1,11 @@ +package buildkit + +import ( + "errors" + + "github.com/moby/buildkit/executor" +) + +func newExecutor(_ string) (executor.Executor, error) { + return nil, errors.New("buildkit executor not implemented for windows") +}