File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,6 +208,7 @@ func (cli *DockerCli) initializeFromClient() {
208208 cli .serverInfo = ServerInfo {
209209 HasExperimental : ping .Experimental ,
210210 OSType : ping .OSType ,
211+ BuildkitEnabled : ping .Buildkit ,
211212 }
212213 cli .client .NegotiateAPIVersionPing (ping )
213214}
@@ -241,6 +242,7 @@ func (cli *DockerCli) NewContainerizedEngineClient(sockPath string) (containeriz
241242type ServerInfo struct {
242243 HasExperimental bool
243244 OSType string
245+ BuildkitEnabled bool
244246}
245247
246248// ClientInfo stores details about the supported features of the client
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import (
1313 "path/filepath"
1414 "regexp"
1515 "runtime"
16- "strconv"
1716 "strings"
1817
1918 "github.com/docker/cli/cli"
@@ -181,14 +180,8 @@ func (out *lastProgressOutput) WriteProgress(prog progress.Progress) error {
181180
182181// nolint: gocyclo
183182func runBuild (dockerCli command.Cli , options buildOptions ) error {
184- if buildkitEnv := os .Getenv ("DOCKER_BUILDKIT" ); buildkitEnv != "" {
185- enableBuildkit , err := strconv .ParseBool (buildkitEnv )
186- if err != nil {
187- return errors .Wrap (err , "DOCKER_BUILDKIT environment variable expects boolean value" )
188- }
189- if enableBuildkit {
190- return runBuildBuildKit (dockerCli , options )
191- }
183+ if dockerCli .ServerInfo ().BuildkitEnabled && dockerCli .ServerInfo ().HasExperimental {
184+ return runBuildBuildKit (dockerCli , options )
192185 }
193186
194187 var (
You can’t perform that action at this time.
0 commit comments