Skip to content

Commit 9607bba

Browse files
authored
Merge pull request #3451 from AkhilManoj03/3121-improve-file-flag-docs
Docs: document remote URL support for --file flag in buildx build
2 parents 6248145 + 1f69c57 commit 9607bba

1 file changed

Lines changed: 27 additions & 3 deletions

File tree

docs/reference/buildx_build.md

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

555555
```console
556-
$ docker buildx build -f <filepath> .
556+
$ docker buildx build -f [PATH|URL|-] .
557557
```
558558

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

562-
To read a Dockerfile from stdin, you can use `-` as the argument for `--file`.
562+
The supported inputs formats are:
563+
564+
- [`Local file path`](#local-file-path)
565+
- [`Remote URL`](#remote-url)
566+
- [`Standard input`](#standard-input)
567+
568+
#### Local file path
569+
570+
To specify a path to a local Dockerfile:
571+
572+
```console
573+
$ docker buildx build -f path/to/Dockerfile .
574+
```
575+
576+
#### Remote URL
577+
578+
To specify a URL to a remote Dockerfile:
579+
580+
```console
581+
$ docker buildx build -f https://raw.githubusercontent.com/docker/buildx/refs/tags/v0.29.0/Dockerfile .
582+
```
583+
584+
#### Standard input
585+
586+
To read a Dockerfile from stdin, use `-` as the argument:
563587

564588
```console
565589
$ cat Dockerfile | docker buildx build -f - .

0 commit comments

Comments
 (0)