Skip to content

docs: clarify Bake environment variable override behavior#3728

Merged
crazy-max merged 1 commit intodocker:masterfrom
allexistence:docs-clarify-bake-env-override
Mar 18, 2026
Merged

docs: clarify Bake environment variable override behavior#3728
crazy-max merged 1 commit intodocker:masterfrom
allexistence:docs-clarify-bake-env-override

Conversation

@allexistence
Copy link
Contributor

Summary

Clarifies the Bake reference docs for environment variable behavior.

The previous wording and example suggested that values like $HOME are
interpolated in the default field. In practice, Bake overrides a declared
variable when an environment variable with the same name is set.

Changes

  • Reworded the section to describe name-based environment variable override
  • Replaced the ambiguous default = "$HOME" example
  • Added a pointer to the overrides documentation

Related:

Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

PTAL @dvdksn

@crazy-max crazy-max requested a review from dvdksn March 16, 2026 12:00
default = "$HOME"
default = "/root"
}
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems it got removed by mistake

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed feedback . PTAL 🙏

Copy link
Contributor

@dvdksn dvdksn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just needs the closing ``` added back!

Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a place where it's worth to mention BUILDX_BAKE_DISABLE_VARS_ENV_LOOKUP as well.

@allexistence allexistence force-pushed the docs-clarify-bake-env-override branch 2 times, most recently from 386af6b to f63107e Compare March 17, 2026 02:24
@allexistence
Copy link
Contributor Author

Addressed feedback:

  • restored missing code fence
  • ensured correct example
  • added note for BUILDX_BAKE_DISABLE_VARS_ENV_LOOKUP

PTAL 🙏

Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you squash your commits please? Thx

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

docs: address review feedback on bake env lookup

Signed-off-by: rishabh <rishank69@gmail.com>
@allexistence
Copy link
Contributor Author

Can you squash your commits please? Thx

PTAL

@crazy-max
Copy link
Member

Is this a place where it's worth to mention BUILDX_BAKE_DISABLE_VARS_ENV_LOOKUP as well.

Yes this is marked as docs follow-up to document this new var: #3595

@dvdksn Seems we have other things left to cover for docs: https://github.com/docker/buildx/pulls?q=is%3Apr+label%3Astatus%2Fneeds-docs-follow-up+is%3Aclosed

@crazy-max crazy-max merged commit de2c485 into docker:master Mar 18, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants