docker/cli ยท error

DOCKER_BUILDKIT environment variable expects boolean value:

Error message

DOCKER_BUILDKIT environment variable expects boolean value: %w

What it means

Error "DOCKER_BUILDKIT environment variable expects boolean value: %w" thrown in docker/cli.

Source

Thrown at cmd/docker/builder.go:59

		return errors.New(errorMsg)
	}
	if pluginLoadErr != nil {
		return fmt.Errorf("%w\n\n%s", pluginLoadErr, errorMsg)
	}
	return errors.New(errorMsg)
}

//nolint:gocyclo
func processBuilder(dockerCli command.Cli, cmd *cobra.Command, args, osargs []string) ([]string, []string, []string, error) {
	var buildKitDisabled, useBuilder, useAlias bool
	var envs []string

	// check DOCKER_BUILDKIT env var is not empty
	// if it is assume we want to use the builder component
	if v := os.Getenv("DOCKER_BUILDKIT"); v != "" {
		enabled, err := strconv.ParseBool(v)
		if err != nil {
			return args, osargs, nil, fmt.Errorf("DOCKER_BUILDKIT environment variable expects boolean value: %w", err)
		}
		if !enabled {
			buildKitDisabled = true
		} else {
			useBuilder = true
		}
	}
	// docker bake always requires buildkit; ignore "DOCKER_BUILDKIT=0".
	if buildKitDisabled && len(args) > 0 && args[0] == "bake" {
		buildKitDisabled = false
	}

	// if a builder alias is defined, use it instead
	// of the default one
	builderAlias := builderDefaultPlugin
	aliasMap := dockerCli.ConfigFile().Aliases
	if v, ok := aliasMap[keyBuilderAlias]; ok {
		useBuilder = true

View on GitHub (pinned to e9452d6e78)

When it happens

Trigger: Thrown at cmd/docker/builder.go:59 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of docker/cli@e9452d6e78 (2026-08-01). Data as JSON: /data/errors/bdee006c16139fcc.json. Report an issue: GitHub.