bake: add pattern matching for targets input#23360
Merged
Merged
Conversation
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
thaJeztah
reviewed
Sep 8, 2025
Comment on lines
+113
to
+117
| # Match all targets starting with 'foo-' | ||
| $ docker buildx bake foo-* | ||
|
|
||
| # Match all targets | ||
| $ docker buildx bake * |
Member
There was a problem hiding this comment.
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
Member
There was a problem hiding this comment.
Yes should be quoted, a note would be good to explain this
crazy-max
reviewed
Sep 8, 2025
| $ docker buildx bake "mtx-a-b-*" | ||
| ``` | ||
|
|
||
| You can also combine multiple patters: |
Member
There was a problem hiding this comment.
Suggested change
| You can also combine multiple patters: | |
| You can also combine multiple patterns: |
| You can also combine multiple patters: | ||
|
|
||
| ```console | ||
| $ docker buildx bake "*" "tests" |
Member
There was a problem hiding this comment.
tests would not be necessary here as we glob everything already. Maybe instead:
Suggested change
| $ docker buildx bake "*" "tests" | |
| $ docker buildx bake "foo*" "tests" |
|
|
||
| ```console | ||
| # Match all targets starting with 'foo-' | ||
| $ docker buildx bake foo-* |
Member
There was a problem hiding this comment.
Suggested change
| $ docker buildx bake foo-* | |
| $ docker buildx bake "foo-*" |
| $ docker buildx bake foo-* | ||
|
|
||
| # Match all targets | ||
| $ docker buildx bake * |
Member
There was a problem hiding this comment.
Suggested change
| $ docker buildx bake * | |
| $ docker buildx bake "*" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds docker/buildx#3280
Related issues or tickets
Reviews