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 <akhil.manoj2003@gmail.com>
Signed-off-by: Akhil Manoj <manoja2@vcu.edu>
This commit is contained in:
Akhil Manoj
2026-02-23 11:34:38 +01:00
committed by CrazyMax
parent 268f1c7e4a
commit 1f69c574eb
+27 -3
View File
@@ -553,13 +553,37 @@ the daemon runs the containers used in the build with the
### <a name="file"></a> Specify a Dockerfile (-f, --file) ### <a name="file"></a> Specify a Dockerfile (-f, --file)
```console ```console
$ docker buildx build -f <filepath> . $ 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. 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)
- [`Standard input`](#standard-input)
#### 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 .
```
#### Standard input
To read a Dockerfile from stdin, use `-` as the argument:
```console ```console
$ cat Dockerfile | docker buildx build -f - . $ cat Dockerfile | docker buildx build -f - .