-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bring back and expose BuildKitEnabled func #3435
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm slightly concerned that there's now 2 implementations to do the BuildKit check (one in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I was thinking of moving some logic to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could we extract the common bits to a non-exported function perhaps? (haven't checked), so something like; func (cli *DockerCli) BuildKitEnabled() (bool, error) {
foo, _, err := doTheBuildKitCheck(cli)
return foo, err
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hum yeah we could do that, let me see. |
||
return args, osargs, nil | ||
} | ||
crazy-max marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
if useLegacy { | ||
// display warning if not wcow and continue | ||
if dockerCli.ServerInfo().OSType != "windows" { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably for a follow-up, but I just realise we don't take older daemons into account. (Should we default to "false" on, daemons that do not yet have BuildKit, or before BuildKit left experimental (BuildKit no longer required
experimental
since 18.09.0; https://docs.docker.com/engine/release-notes/18.09/#new-features)