docs: clarify Bake environment variable override behavior

Signed-off-by: rishabh <rishank69@gmail.com>

docs: address review feedback on bake env lookup

Signed-off-by: rishabh <rishank69@gmail.com>
This commit is contained in:
rishabh
2026-03-18 22:51:13 +08:00
parent c461e702bf
commit 8bcf041190
+8 -2
View File
@@ -1350,11 +1350,17 @@ to define them.
### Use environment variable as default
You can set a Bake variable to use the value of an environment variable as a default value:
If an environment variable exists with the same name as a declared Bake
variable, Bake uses that environment variable value instead of the declared
default.
To disable this environment-based variable lookup, set
`BUILDX_BAKE_DISABLE_VARS_ENV_LOOKUP=1`.
```hcl
variable "HOME" {
default = "$HOME"
default = "/root"
}
```