Bake resolves files relative to the bake file
Introduced 2026-07-29 · score 0.94
HOW TO USE IT
When Bake file paths should resolve from the file that defines them, set `BUILDX_BAKE_FILE_RELATIVE_PATHS=true` and run Bake. The setting applies to local directory paths in `target.context` and `target.contexts`; use `cwd://` for paths that should stay relative to the working directory.
BUILDX_BAKE_FILE_RELATIVE_PATHS=true docker buildx bake -f <bake-file> [<target>...]WHY THIS HELPS
Run Bake when file paths should resolve from the bake file's location instead of the current working directory.
BEFORE THIS CHANGE
By default, local directory build contexts in Bake files resolve from the current working directory.
REQUIREMENTS AND LIMITATIONS
- Version: v0.36.0
- BUILDX_BAKE_FILE_RELATIVE_PATHS (required): Set to `true` to enable file-relative path resolution. The v0.36.0 release note uses `true`; the tagged reference documents the equivalent setting as `1`.
- -f, --file <file>: Select the Bake definition file; Bake searches the current working directory if omitted.
- Prerequisite: Use Buildx v0.36.0 or later for this change.
FIRST-PARTY EVIDENCE
- https://github.com/docker/buildx/releases/tag/v0.36.0
- https://github.com/docker/buildx/blob/v0.36.0/docs/bake-reference.md
- https://docs.docker.com/reference/cli/docker/buildx/bake/
Check the installed version and the source before using it. Entry JSON