-
Notifications
You must be signed in to change notification settings - Fork 7.9k
bake: add pattern matching for targets input #23360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
# Match all targets starting with 'foo-' | ||
$ docker buildx bake foo-* | ||
|
||
# Match all targets | ||
$ docker buildx bake * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably call out that the value must be quoted to prevent the user's shell from expanding. Without quotes, the shell will expand to files in the current directory, which will fail in most cases, e.g.;
docker buildx bake *
[+] Building 0.0s (1/1) FINISHED docker:desktop-linux
=> [internal] load local bake definitions 0.0s
=> => reading docker-bake.hcl 4.02kB / 4.02kB 0.0s
ERROR: failed to find target api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes should be quoted, a note would be good to explain this
$ docker buildx bake "mtx-a-b-*" | ||
``` | ||
|
||
You can also combine multiple patters: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also combine multiple patters: | |
You can also combine multiple patterns: |
You can also combine multiple patters: | ||
|
||
```console | ||
$ docker buildx bake "*" "tests" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests
would not be necessary here as we glob everything already. Maybe instead:
$ docker buildx bake "*" "tests" | |
$ docker buildx bake "foo*" "tests" |
|
||
```console | ||
# Match all targets starting with 'foo-' | ||
$ docker buildx bake foo-* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ docker buildx bake foo-* | |
$ docker buildx bake "foo-*" |
$ docker buildx bake foo-* | ||
|
||
# Match all targets | ||
$ docker buildx bake * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ docker buildx bake * | |
$ docker buildx bake "*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Description
Adds docker/buildx#3280
Related issues or tickets
Reviews