build: use legacy builder for wcow if not opt-in with a builder component

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2022-02-23 16:20:45 +01:00
parent e38e6c51ff
commit e7a8748b93
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
1 changed files with 7 additions and 2 deletions

View File

@ -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) { func processBuilder(dockerCli command.Cli, cmd *cobra.Command, args, osargs []string) ([]string, []string, error) {
var useLegacy bool var useLegacy, useBuilder bool
var useBuilder bool
// check DOCKER_BUILDKIT env var is present and // check DOCKER_BUILDKIT env var is present and
// if not assume we want to use the builder component // 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 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 { if useLegacy {
// display warning if not wcow and continue // display warning if not wcow and continue
if dockerCli.ServerInfo().OSType != "windows" { if dockerCli.ServerInfo().OSType != "windows" {