docs: add example for --list=variables with variable descriptions

Signed-off-by: rishabh <rishank69@gmail.com>
This commit is contained in:
rishabh
2026-03-23 12:04:02 +08:00
parent ba04f8f7b4
commit 0dede5c898
+18
View File
@@ -213,6 +213,24 @@ DEBUG bool false Add debug symbols
Variable types will be shown when set using the `type` property in the Bake file.
The `--list=variables` option displays variables defined in the Bake file, including their descriptions and default values.
### Example: listing variables with descriptions
```hcl
variable "GO_VERSION" {
default = "1.22"
description = "Go version used for building the application"
}
```
```console
$ docker buildx bake --list=variables
NAME DESCRIPTION DEFAULT
GO_VERSION Go version used for building the application 1.22
```
By default, the output of `docker buildx bake --list` is presented in a table
format. Alternatively, you can use a long-form CSV syntax and specify a
`format` attribute to output the list in JSON.