From e7a8748b939fbf7798352cff1e0b87ef26bf0002 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Wed, 23 Feb 2022 16:20:45 +0100 Subject: [PATCH] build: use legacy builder for wcow if not opt-in with a builder component Signed-off-by: CrazyMax --- cmd/docker/builder.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/docker/builder.go b/cmd/docker/builder.go index 03d6055b8e..31c6076046 100644 --- a/cmd/docker/builder.go +++ b/cmd/docker/builder.go @@ -41,8 +41,7 @@ func newBuilderError(warn bool, err error) error { } func processBuilder(dockerCli command.Cli, cmd *cobra.Command, args, osargs []string) ([]string, []string, error) { - var useLegacy bool - var useBuilder bool + var useLegacy, useBuilder bool // check DOCKER_BUILDKIT env var is present and // if not assume we want to use the builder component @@ -73,6 +72,12 @@ func processBuilder(dockerCli command.Cli, cmd *cobra.Command, args, osargs []st return args, osargs, nil } + // wcow build command must use the legacy builder + // if not opt-in through a builder component + if !useBuilder && dockerCli.ServerInfo().OSType == "windows" { + return args, osargs, nil + } + if useLegacy { // display warning if not wcow and continue if dockerCli.ServerInfo().OSType != "windows" {