Home Explore Blog CI



docker

5th chunk of `content/manuals/build/building/variables.md`
f45df2a9cafc38f5c131d0407e8b05ff40e91d4db5216fa00000000100000fb4
| [BUILDX_EXPERIMENTAL](#buildx_experimental)                                 | Boolean           | Turn on experimental features.                                   |
| [BUILDX_GIT_CHECK_DIRTY](#buildx_git_check_dirty)                           | Boolean           | Enable dirty Git checkout detection.                             |
| [BUILDX_GIT_INFO](#buildx_git_info)                                         | Boolean           | Remove Git information in provenance attestations.               |
| [BUILDX_GIT_LABELS](#buildx_git_labels)                                     | String \| Boolean | Add Git provenance labels to images.                             |
| [BUILDX_MEM_PROFILE](#buildx_mem_profile)                                   | String            | Generate a `pprof` memory profile at the specified location.     |
| [BUILDX_METADATA_PROVENANCE](#buildx_metadata_provenance)                   | String \| Boolean | Customize provenance informations included in the metadata file. |
| [BUILDX_METADATA_WARNINGS](#buildx_metadata_warnings)                       | String            | Include build warnings in the metadata file.                     |
| [BUILDX_NO_DEFAULT_ATTESTATIONS](#buildx_no_default_attestations)           | Boolean           | Turn off default provenance attestations.                        |
| [BUILDX_NO_DEFAULT_LOAD](#buildx_no_default_load)                           | Boolean           | Turn off loading images to image store by default.               |
| [EXPERIMENTAL_BUILDKIT_SOURCE_POLICY](#experimental_buildkit_source_policy) | String            | Specify a BuildKit source policy file.                           |

BuildKit also supports a few additional configuration parameters. Refer to
[BuildKit built-in build args](/reference/dockerfile.md#buildkit-built-in-build-args).

You can express Boolean values for environment variables in different ways.
For example, `true`, `1`, and `T` all evaluate to true.
Evaluation is done using the `strconv.ParseBool` function in the Go standard library.
See the [reference documentation](https://pkg.go.dev/strconv#ParseBool) for details.

<!-- vale Docker.HeadingSentenceCase = NO -->

### BUILDKIT_COLORS

Changes the colors of the terminal output. Set `BUILDKIT_COLORS` to a CSV string
in the following format:

```console
$ export BUILDKIT_COLORS="run=123,20,245:error=yellow:cancel=blue:warning=white"
```

Color values can be any valid RGB hex code, or one of the
[BuildKit predefined colors](https://github.com/moby/buildkit/blob/master/util/progress/progressui/colors.go).

Setting `NO_COLOR` to anything turns off colorized output, as recommended by
[no-color.org](https://no-color.org/).

### BUILDKIT_HOST

{{< summary-bar feature_name="Buildkit host" >}}

You use the `BUILDKIT_HOST` to specify the address of a BuildKit daemon to use
as a remote builder. This is the same as specifying the address as a positional
argument to `docker buildx create`.

Usage:

```console
$ export BUILDKIT_HOST=tcp://localhost:1234
$ docker buildx create --name=remote --driver=remote
```

If you specify both the `BUILDKIT_HOST` environment variable and a positional
argument, the argument takes priority.

### BUILDKIT_PROGRESS

Sets the type of the BuildKit progress output. Valid values are:

- `auto` (default)
- `plain`
- `tty`
- `quiet`
- `rawjson`

Usage:

```console
$ export BUILDKIT_PROGRESS=plain
```

### BUILDKIT_TTY_LOG_LINES

You can change how many log lines are visible for active steps in TTY mode by
setting `BUILDKIT_TTY_LOG_LINES` to a number (default to `6`).

```console
$ export BUILDKIT_TTY_LOG_LINES=8
```

### EXPERIMENTAL_BUILDKIT_SOURCE_POLICY

Lets you specify a
[BuildKit source policy](https://github.com/moby/buildkit/blob/master/docs/build-repro.md#reproducing-the-pinned-dependencies)
file for creating reproducible builds with pinned dependencies.

```console
$ export EXPERIMENTAL_BUILDKIT_SOURCE_POLICY=./policy.json
```

Example:

```json
{
  "rules": [
    {
      "action": "CONVERT",

Title: Detailed Configuration Variables for Buildx and BuildKit
Summary
This section continues detailing specific configuration variables for Buildx and BuildKit. It lists variables such as `BUILDX_EXPERIMENTAL`, `BUILDX_GIT_CHECK_DIRTY`, `BUILDX_GIT_INFO`, `BUILDX_GIT_LABELS`, `BUILDX_MEM_PROFILE`, `BUILDX_METADATA_PROVENANCE`, `BUILDX_METADATA_WARNINGS`, `BUILDX_NO_DEFAULT_ATTESTATIONS`, `BUILDX_NO_DEFAULT_LOAD`, and `EXPERIMENTAL_BUILDKIT_SOURCE_POLICY` along with their types and descriptions. The section further explains how to express boolean values for these variables and elaborates on the functionalities of `BUILDKIT_COLORS`, `BUILDKIT_HOST`, `BUILDKIT_PROGRESS`, `BUILDKIT_TTY_LOG_LINES`, and `EXPERIMENTAL_BUILDKIT_SOURCE_POLICY` with usage examples.