Skip to content

Commit 734ef94

Browse files
committed
build: add buildx pprof variables
Signed-off-by: David Karlsson <[email protected]>
1 parent b1256d5 commit 734ef94

File tree

1 file changed

+55
-18
lines changed

1 file changed

+55
-18
lines changed

content/manuals/build/building/variables.md

Lines changed: 55 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -304,24 +304,26 @@ Note that these variables aren't used to configure the build container;
304304
they aren't available inside the build and they have no relation to the `ENV` instruction.
305305
They're used to configure the Buildx client, or the BuildKit daemon.
306306

307-
| Variable | Type | Description |
308-
| --------------------------------------------------------------------------- | ----------------- | ---------------------------------------------------- |
309-
| [BUILDKIT_COLORS](#buildkit_colors) | String | Configure text color for the terminal output. |
310-
| [BUILDKIT_HOST](#buildkit_host) | String | Specify host to use for remote builders. |
311-
| [BUILDKIT_PROGRESS](#buildkit_progress) | String | Configure type of progress output. |
312-
| [BUILDKIT_TTY_LOG_LINES](#buildkit_tty_log_lines) | String | Number of log lines (for active steps in TTY mode). |
313-
| [BUILDX_BAKE_GIT_AUTH_HEADER](#buildx_bake_git_auth_header) | String | HTTP authentication scheme for remote Bake files. |
314-
| [BUILDX_BAKE_GIT_AUTH_TOKEN](#buildx_bake_git_auth_token) | String | HTTP authentication token for remote Bake files. |
315-
| [BUILDX_BAKE_GIT_SSH](#buildx_bake_git_ssh) | String | SSH authentication for remote Bake files. |
316-
| [BUILDX_BUILDER](#buildx_builder) | String | Specify the builder instance to use. |
317-
| [BUILDX_CONFIG](#buildx_config) | String | Specify location for configuration, state, and logs. |
318-
| [BUILDX_EXPERIMENTAL](#buildx_experimental) | Boolean | Turn on experimental features. |
319-
| [BUILDX_GIT_CHECK_DIRTY](#buildx_git_check_dirty) | Boolean | Enable dirty Git checkout detection. |
320-
| [BUILDX_GIT_INFO](#buildx_git_info) | Boolean | Remove Git information in provenance attestations. |
321-
| [BUILDX_GIT_LABELS](#buildx_git_labels) | String \| Boolean | Add Git provenance labels to images. |
322-
| [BUILDX_NO_DEFAULT_ATTESTATIONS](#buildx_no_default_attestations) | Boolean | Turn off default provenance attestations. |
323-
| [BUILDX_NO_DEFAULT_LOAD](#buildx_no_default_load) | Boolean | Turn off loading images to image store by default. |
324-
| [EXPERIMENTAL_BUILDKIT_SOURCE_POLICY](#experimental_buildkit_source_policy) | String | Specify a BuildKit source policy file. |
307+
| Variable | Type | Description |
308+
| --------------------------------------------------------------------------- | ----------------- | ---------------------------------------------------------- |
309+
| [BUILDKIT_COLORS](#buildkit_colors) | String | Configure text color for the terminal output. |
310+
| [BUILDKIT_HOST](#buildkit_host) | String | Specify host to use for remote builders. |
311+
| [BUILDKIT_PROGRESS](#buildkit_progress) | String | Configure type of progress output. |
312+
| [BUILDKIT_TTY_LOG_LINES](#buildkit_tty_log_lines) | String | Number of log lines (for active steps in TTY mode). |
313+
| [BUILDX_BAKE_GIT_AUTH_HEADER](#buildx_bake_git_auth_header) | String | HTTP authentication scheme for remote Bake files. |
314+
| [BUILDX_BAKE_GIT_AUTH_TOKEN](#buildx_bake_git_auth_token) | String | HTTP authentication token for remote Bake files. |
315+
| [BUILDX_BAKE_GIT_SSH](#buildx_bake_git_ssh) | String | SSH authentication for remote Bake files. |
316+
| [BUILDX_BUILDER](#buildx_builder) | String | Specify the builder instance to use. |
317+
| [BUILDX_CONFIG](#buildx_config) | String | Specify location for configuration, state, and logs. |
318+
| [BUILDX_CPU_PROFILE](#buildx_cpu_profile) | String | Generate a pprof CPU profile at the specified location. |
319+
| [BUILDX_EXPERIMENTAL](#buildx_experimental) | Boolean | Turn on experimental features. |
320+
| [BUILDX_GIT_CHECK_DIRTY](#buildx_git_check_dirty) | Boolean | Enable dirty Git checkout detection. |
321+
| [BUILDX_GIT_INFO](#buildx_git_info) | Boolean | Remove Git information in provenance attestations. |
322+
| [BUILDX_GIT_LABELS](#buildx_git_labels) | String \| Boolean | Add Git provenance labels to images. |
323+
| [BUILDX_MEM_PROFILE](#buildx_mem_profile) | String | Generate a pprof memory profile at the specified location. |
324+
| [BUILDX_NO_DEFAULT_ATTESTATIONS](#buildx_no_default_attestations) | Boolean | Turn off default provenance attestations. |
325+
| [BUILDX_NO_DEFAULT_LOAD](#buildx_no_default_load) | Boolean | Turn off loading images to image store by default. |
326+
| [EXPERIMENTAL_BUILDKIT_SOURCE_POLICY](#experimental_buildkit_source_policy) | String | Specify a BuildKit source policy file. |
325327

326328
BuildKit also supports a few additional configuration parameters. Refer to
327329
[BuildKit built-in build args](/reference/dockerfile.md#buildkit-built-in-build-args).
@@ -507,6 +509,23 @@ Usage:
507509
$ export BUILDX_CONFIG=/usr/local/etc
508510
```
509511

512+
### BUILDX_CPU_PROFILE
513+
514+
{{< introduced buildx 0.18.0 >}}
515+
516+
If specified, Buildx generates a `pprof` CPU profile at the specified location.
517+
518+
A CPU profile records where your program spends CPU time. By analyzing a CPU
519+
profile, you can identify functions that consume the most processing power.
520+
This helps you optimize code paths, reduce latency, and improve overall
521+
performance.
522+
523+
Usage:
524+
525+
```console
526+
$ export BUILDX_CPU_PROFILE=buildx_cpu.prof
527+
```
528+
510529
### BUILDX_EXPERIMENTAL
511530

512531
Enables experimental build features.
@@ -572,6 +591,24 @@ Usage:
572591

573592
If the repository is in a dirty state, the `revision` gets a `-dirty` suffix.
574593

594+
### BUILDX_MEM_PROFILE
595+
596+
{{< introduced buildx 0.18.0 >}}
597+
598+
If specified, Buildx generates a `pprof` memory profile at the specified
599+
location.
600+
601+
A memory profile tracks your program's memory allocations. It highlights which
602+
parts of the code are responsible for using the most memory, helping to detect
603+
memory leaks or unnecessary allocations, which can lead to memory exhaustion or
604+
slowdowns.
605+
606+
Usage:
607+
608+
```console
609+
$ export BUILDX_MEM_PROFILE=buildx_mem.prof
610+
```
611+
575612
### BUILDX_NO_DEFAULT_ATTESTATIONS
576613

577614
{{< introduced buildx 0.10.4 "../release-notes.md#0104" >}}

0 commit comments

Comments
 (0)