Skip to content

Commit 239b78b

Browse files
committed
docs(bake): improve docs on "call" and "description" in bake file
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
1 parent ada44e8 commit 239b78b

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

docs/bake-reference.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,10 @@ The following table shows the complete list of attributes that you can assign to
221221
| [`attest`](#targetattest) | List | Build attestations |
222222
| [`cache-from`](#targetcache-from) | List | External cache sources |
223223
| [`cache-to`](#targetcache-to) | List | External cache destinations |
224+
| [`call`](#targetcall) | String | Specify the frontend method to call for the target. |
224225
| [`context`](#targetcontext) | String | Set of files located in the specified path or URL |
225226
| [`contexts`](#targetcontexts) | Map | Additional build contexts |
227+
| [`description`](#targetdescription) | String | Description of a target |
226228
| [`dockerfile-inline`](#targetdockerfile-inline) | String | Inline Dockerfile string |
227229
| [`dockerfile`](#targetdockerfile) | String | Dockerfile location |
228230
| [`inherits`](#targetinherits) | List | Inherit attributes from other targets |
@@ -371,6 +373,13 @@ target "app" {
371373
}
372374
```
373375

376+
Supported values are:
377+
378+
- `build` builds the target (default)
379+
- `check`: evaluates [build checks](https://docs.docker.com/build/checks/) for the target
380+
- `outline`: displays the target's build arguments and their default values if available
381+
- `targets`: lists all Bake targets in the loaded definition, along with its [description](#targetdescription).
382+
374383
For more information about frontend methods, refer to the CLI reference for
375384
[`docker buildx build --call`](https://docs.docker.com/reference/cli/docker/buildx/build/#call).
376385

@@ -481,6 +490,25 @@ FROM baseapp
481490
RUN echo "Hello world"
482491
```
483492

493+
### `target.description`
494+
495+
Defines a human-readable description for the target, clarifying its purpose or
496+
functionality.
497+
498+
```hcl
499+
target "lint" {
500+
description = "Runs golangci-lint to detect style errors"
501+
args = {
502+
GOLANGCI_LINT_VERSION = null
503+
}
504+
dockerfile = "lint.Dockerfile"
505+
}
506+
```
507+
508+
This attribute is useful when combined with the `docker buildx bake --list=targets`
509+
option, providing a more informative output when listing the available build
510+
targets in a Bake file.
511+
484512
### `target.dockerfile-inline`
485513

486514
Uses the string value as an inline Dockerfile for the build target.

0 commit comments

Comments
 (0)