Skip to content

Commit f48bd18

Browse files
authored
Merge pull request #3737 from allexistence/docs-variable-example
docs: add example for --list=variables with variable descriptions
2 parents dc5f986 + 0dede5c commit f48bd18

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/reference/buildx_bake.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,24 @@ DEBUG bool false Add debug symbols
213213

214214
Variable types will be shown when set using the `type` property in the Bake file.
215215

216+
The `--list=variables` option displays variables defined in the Bake file, including their descriptions and default values.
217+
218+
### Example: listing variables with descriptions
219+
220+
```hcl
221+
variable "GO_VERSION" {
222+
default = "1.22"
223+
description = "Go version used for building the application"
224+
}
225+
```
226+
227+
```console
228+
$ docker buildx bake --list=variables
229+
230+
NAME DESCRIPTION DEFAULT
231+
GO_VERSION Go version used for building the application 1.22
232+
```
233+
216234
By default, the output of `docker buildx bake --list` is presented in a table
217235
format. Alternatively, you can use a long-form CSV syntax and specify a
218236
`format` attribute to output the list in JSON.

0 commit comments

Comments
 (0)