From 967471deee4fa7a8718e7378eed98ec479ebde5e Mon Sep 17 00:00:00 2001 From: Akhil Manoj Date: Sun, 5 Oct 2025 17:43:13 -0400 Subject: [PATCH] Docs: update --file flag to clarify input options Expand the buildx build doc to include details on the supported input options for the --file flag: local file path, remote URL, and stdin. Add examples for each input type to enhance user understanding. Signed-off-by: Akhil Manoj Signed-off-by: Akhil Manoj --- docs/reference/buildx_build.md | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/docs/reference/buildx_build.md b/docs/reference/buildx_build.md index a4af344723d6..7d1ac50bde63 100644 --- a/docs/reference/buildx_build.md +++ b/docs/reference/buildx_build.md @@ -547,13 +547,37 @@ the daemon runs the containers used in the build with the ### Specify a Dockerfile (-f, --file) ```console -$ docker buildx build -f . +$ docker buildx build -f [PATH|URL|-] . ``` -Specifies the filepath of the Dockerfile to use. +Specifies the location of the Dockerfile to use. If unspecified, a file named `Dockerfile` at the root of the build context is used by default. -To read a Dockerfile from stdin, you can use `-` as the argument for `--file`. +The supported inputs formats are: + +- [`local file path`](#local-file-path) +- [`remote URL`](#remote-url) +- [`stdin`](#stdin) + +#### local file path + +To specify a path to a local Dockerfile: + +```console +$ docker buildx build -f path/to/Dockerfile . +``` + +#### remote URL + +To specify a URL to a remote Dockerfile: + +```console +$ docker buildx build -f https://raw.githubusercontent.com/docker/buildx/refs/tags/v0.29.0/Dockerfile . +``` + +#### stdin + +To read a Dockerfile from stdin, you can use `-` as the argument: ```console $ cat Dockerfile | docker buildx build -f - .