Skip to content

Commit 83d5132

Browse files
committed
bake: add pattern matching for targets input
1 parent 4b3efa0 commit 83d5132

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

content/manuals/build/bake/targets.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,42 @@ command.
9696
$ docker buildx bake all
9797
```
9898

99+
## Pattern matching for targets and groups
100+
101+
Bake supports shell-style wildcard patterns when specifying target or grouped targets.
102+
This makes it easier to build multiple targets without listing each one explicitly.
103+
104+
Supported patterns:
105+
106+
- `*` matches any sequence of characters
107+
- `?` matches any single character
108+
- `[abc]` matches any character in brackets
109+
110+
Examples:
111+
112+
```console
113+
# Match all targets starting with 'foo-'
114+
$ docker buildx bake foo-*
115+
116+
# Match all targets
117+
$ docker buildx bake *
118+
119+
# Matches: foo-baz, foo-caz, foo-daz, etc.
120+
$ docker buildx bake "foo-?az"
121+
122+
# Matches: foo-bar, boo-bar
123+
$ docker buildx bake "[fb]oo-bar"
124+
125+
# Matches: mtx-a-b-d, mtx-a-b-e, mtx-a-b-f
126+
$ docker buildx bake "mtx-a-b-*"
127+
```
128+
129+
You can also combine multiple patters:
130+
131+
```console
132+
$ docker buildx bake "*" "tests"
133+
```
134+
99135
## Additional resources
100136

101137
Refer to the following pages to learn more about Bake's features:

0 commit comments

Comments
 (0)