Skip to content

Commit 0dede5c

Browse files
committed
docs: add example for --list=variables with variable descriptions
Signed-off-by: rishabh <rishank69@gmail.com>
1 parent ba04f8f commit 0dede5c

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

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)