Skip to content

Commit fe988e1

Browse files
authored
Build: bake file env variables (#23347)
<!--Delete sections as needed --> ## Description Adds docker/buildx#3242 ## Related issues or tickets <!-- Related issues, pull requests, or Jira tickets --> ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [ ] Technical review - [ ] Editorial review - [ ] Product review
1 parent e317fb5 commit fe988e1

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

content/manuals/build/building/variables.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ They're used to configure the Buildx client, or the BuildKit daemon.
310310
| [BUILDKIT_HOST](#buildkit_host) | String | Specify host to use for remote builders. |
311311
| [BUILDKIT_PROGRESS](#buildkit_progress) | String | Configure type of progress output. |
312312
| [BUILDKIT_TTY_LOG_LINES](#buildkit_tty_log_lines) | String | Number of log lines (for active steps in TTY mode). |
313+
| [BUILDX_BAKE_FILE](#buildx_bake_file) | String | Specify the build definition file(s) for `docker buildx bake`. |
314+
| [BUILDX_BAKE_FILE_SEPARATOR](#buildx_bake_file_separator) | String | Specify the file-path separator for `BUILDX_BAKE_FILE`. |
313315
| [BUILDX_BAKE_GIT_AUTH_HEADER](#buildx_bake_git_auth_header) | String | HTTP authentication scheme for remote Bake files. |
314316
| [BUILDX_BAKE_GIT_AUTH_TOKEN](#buildx_bake_git_auth_token) | String | HTTP authentication token for remote Bake files. |
315317
| [BUILDX_BAKE_GIT_SSH](#buildx_bake_git_ssh) | String | SSH authentication for remote Bake files. |
@@ -438,6 +440,44 @@ Example:
438440
}
439441
```
440442

443+
### BUILDX_BAKE_FILE
444+
445+
{{< summary-bar feature_name="Buildx bake file" >}}
446+
447+
Specify one or more build definition files for `docker buildx bake`.
448+
449+
This environment variable provides an alternative to the `-f` / `--file` command-line flag.
450+
451+
Multiple files can be specified by separating them with the system path separator (":" on Linux/macOS, ";" on Windows):
452+
453+
```console
454+
export BUILDX_BAKE_FILE=file1.hcl:file2.hcl
455+
```
456+
457+
Or with a custom separator defined by the [BUILDX_BAKE_FILE_SEPARATOR](#buildx_bake_file_separator) variable:
458+
459+
```console
460+
export BUILDX_BAKE_FILE_SEPARATOR=@
461+
462+
```
463+
464+
If both `BUILDX_BAKE_FILE` and the `-f` flag are set, only the files provided via `-f` are used.
465+
466+
If a listed file does not exist or is invalid, bake returns an error.
467+
468+
### BUILDX_BAKE_FILE_SEPARATOR
469+
470+
{{< summary-bar feature_name="Buildx bake file separator" >}}
471+
472+
Controls the separator used between file paths in the `BUILDX_BAKE_FILE` environment variable.
473+
474+
This is useful if your file paths contain the default separator character or if you want to standardize separators across different platforms.
475+
476+
```console
477+
export BUILDX_BAKE_PATH_SEPARATOR=@
478+
479+
```
480+
441481
### BUILDX_BAKE_GIT_AUTH_HEADER
442482

443483
{{< summary-bar feature_name="Buildx bake Git auth token" >}}

data/summary.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ Build privileged:
3737
requires: Docker Compose [2.15.0](/manuals/compose/releases/release-notes.md#2) and later
3838
Build ulimits:
3939
requires: Docker Compose [2.23.1](/manuals/compose/releases/release-notes.md#2231) and later
40+
Buildx bake file:
41+
requires: Docker Buildx [0.26.0](/manuals/build/release-notes.md#0260) and later
42+
Buildx bake file separator:
43+
requires: Docker Buildx [0.26.0](/manuals/build/release-notes.md#0260) and later
4044
Buildx bake Git auth token:
4145
requires: Docker Buildx [0.14.0](/manuals/build/release-notes.md#0140) and later
4246
Buildx bake Git SSH:

0 commit comments

Comments
 (0)