From a516d3fb373395915681c27ccace4bf1be4c42bd Mon Sep 17 00:00:00 2001 From: Justin Chadwell Date: Tue, 11 Nov 2025 16:15:39 +0000 Subject: [PATCH] docs: document using build contexts to override syntax directive Signed-off-by: Justin Chadwell --- docs/reference/buildx_build.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/reference/buildx_build.md b/docs/reference/buildx_build.md index 766042a0a..a1f4dc41e 100644 --- a/docs/reference/buildx_build.md +++ b/docs/reference/buildx_build.md @@ -241,8 +241,13 @@ Learn more about the built-in build arguments in the [Dockerfile reference docs] --build-context=name=VALUE ``` -Define additional build context with specified contents. In Dockerfile the context can be accessed when `FROM name` or `--from=name` is used. -When Dockerfile defines a stage with the same name it is overwritten. +Define additional build context with specified contents. + +In a Dockerfile: + +- the context can be accessed when `FROM name` or `--from=name` is used +- the context overrides a stage called `name` when used as `FROM ... AS name` +- the context overrides a `#syntax` directive when used as `#syntax=name` The value can be a: