Skip to content

docs: clarify Bake environment variable override behavior - #3728

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

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

Conversation

@allexistence

Copy link
Copy Markdown
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:

@crazy-maxcrazy-max left a comment

Copy link
Copy Markdown
Member

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 dvdksnMarch 16, 2026 12:00
default = "$HOME"
default = "/root"
}
```

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Addressed feedback . PTAL 🙏

@dvdksndvdksn left a comment

Copy link
Copy Markdown
Contributor

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!

@tonistiigitonistiigi left a comment

Copy link
Copy Markdown
Member

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
allexistenceforce-pushed the docs-clarify-bake-env-override branch 2 times, most recently from 386af6b to f63107eCompareMarch 17, 2026 02:24
@allexistence

Copy link
Copy Markdown
ContributorAuthor

Addressed feedback:

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

PTAL 🙏

@crazy-maxcrazy-max left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
ContributorAuthor

Can you squash your commits please? Thx

PTAL

@crazy-max

Copy link
Copy Markdown
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:masterMar 18, 2026
40 checks passed
@allexistence
allexistence deleted the docs-clarify-bake-env-override branch April 6, 2026 02:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@allexistence@crazy-max@tonistiigi@dvdksn