Skip to content

Commit 7e9b39c

Browse files
committed
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 <[email protected]>
1 parent fe4f8c1 commit 7e9b39c

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

docs/reference/buildx_build.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,13 +547,37 @@ the daemon runs the containers used in the build with the
547547
### <a name="file"></a> Specify a Dockerfile (-f, --file)
548548

549549
```console
550-
$ docker buildx build -f <filepath> .
550+
$ docker buildx build -f [PATH|URL|-] .
551551
```
552552

553-
Specifies the filepath of the Dockerfile to use.
553+
Specifies the location of the Dockerfile to use.
554554
If unspecified, a file named `Dockerfile` at the root of the build context is used by default.
555555

556-
To read a Dockerfile from stdin, you can use `-` as the argument for `--file`.
556+
The supported inputs formats are:
557+
558+
- [`local file path`](#local-file-path)
559+
- [`remote URL`](#remote-url)
560+
- [`stdin`](#stdin)
561+
562+
#### local file path
563+
564+
To specify a path to a local Dockerfile:
565+
566+
```console
567+
$ docker buildx build -f path/to/Dockerfile .
568+
```
569+
570+
#### remote URL
571+
572+
To specify a URL to a remote Dockerfile:
573+
574+
```console
575+
$ docker buildx build -f https://raw.githubusercontent.com/docker/buildx/refs/tags/v0.29.0/Dockerfile .
576+
```
577+
578+
#### stdin
579+
580+
To read a Dockerfile from stdin, you can use `-` as the argument:
557581

558582
```console
559583
$ cat Dockerfile | docker buildx build -f - .

0 commit comments

Comments
 (0)