docs: add variable attribute

Signed-off-by: aevesdocker <allie.sadler@docker.com>
This commit is contained in:
aevesdocker
2025-09-10 15:19:41 +01:00
parent 3922da8029
commit 2b991cb800
+3
View File
@@ -1099,6 +1099,7 @@ or interpolate them in attribute values in your Bake file.
variable "TAG" { variable "TAG" {
type = string type = string
default = "latest" default = "latest"
description: "Tag to use for build"
} }
target "webapp-dev" { target "webapp-dev" {
@@ -1111,6 +1112,8 @@ You can assign a default value for a variable in the Bake file,
or assign a `null` value to it. If you assign a `null` value, or assign a `null` value to it. If you assign a `null` value,
Buildx uses the default value from the Dockerfile instead. Buildx uses the default value from the Dockerfile instead.
You can also add a description of the variables purpose with the `description` field. This attribute is useful when combined with the `docker buildx bake --list=variables` option, providing a more informative output when listing the available variables in a Bake file.
You can override variable defaults set in the Bake file using environment variables. You can override variable defaults set in the Bake file using environment variables.
The following example sets the `TAG` variable to `dev`, The following example sets the `TAG` variable to `dev`,
overriding the default `latest` value shown in the previous example. overriding the default `latest` value shown in the previous example.