mirror of https://github.com/docker/cli.git
build: use strconv.ParseBool to parse DOCKER_BUILDKIT to allow value "0"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 721000e6c9
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
0627568d60
commit
359d5c8a76
|
@ -13,6 +13,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/docker/cli/cli"
|
"github.com/docker/cli/cli"
|
||||||
|
@ -176,8 +177,14 @@ func (out *lastProgressOutput) WriteProgress(prog progress.Progress) error {
|
||||||
|
|
||||||
// nolint: gocyclo
|
// nolint: gocyclo
|
||||||
func runBuild(dockerCli command.Cli, options buildOptions) error {
|
func runBuild(dockerCli command.Cli, options buildOptions) error {
|
||||||
if os.Getenv("DOCKER_BUILDKIT") != "" {
|
if buildkitEnv := os.Getenv("DOCKER_BUILDKIT"); buildkitEnv != "" {
|
||||||
return runBuildBuildKit(dockerCli, options)
|
enableBuildkit, err := strconv.ParseBool(buildkitEnv)
|
||||||
|
if err != nil {
|
||||||
|
return errors.Wrap(err, "DOCKER_BUILDKIT environment variable expects boolean value")
|
||||||
|
}
|
||||||
|
if enableBuildkit {
|
||||||
|
return runBuildBuildKit(dockerCli, options)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
Loading…
Reference in New Issue