-
Notifications
You must be signed in to change notification settings - Fork 483
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
Proposal: add new --sync-output flag to bake #1197
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -25,6 +25,7 @@ Build from a file | |||||
| [`--pull`](#pull) | | | Always attempt to pull all referenced images | | ||||||
| `--push` | | | Shorthand for `--set=*.output=type=registry` | | ||||||
| [`--set`](#set) | `stringArray` | | Override target value (e.g., `targetpattern.key=value`) | | ||||||
| `--sync-output` | | | Ensure all builds complete before beginning output | | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe
Suggested change
Let's also add a simple example here for this flag. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think |
||||||
|
||||||
|
||||||
<!---MARKER_GEN_END--> | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/out |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM busybox | ||
RUN echo bar > /bar | ||
|
||
FROM scratch | ||
COPY --from=0 /bar /bar |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
group "default" { | ||
targets = ["foo", "bar"] | ||
} | ||
|
||
target "foo" { | ||
dockerfile = "foo.Dockerfile" | ||
output = ["out"] | ||
} | ||
|
||
target "bar" { | ||
dockerfile = "bar.Dockerfile" | ||
output = ["out"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM busybox | ||
RUN echo foo > /foo | ||
|
||
FROM scratch | ||
COPY --from=0 /foo /foo |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
rm -rf ./out | ||
|
||
docker buildx bake --print | ||
docker buildx bake --sync-output | ||
|
||
if [[ ! -f ./out/foo || ! -f ./out/bar ]]; then | ||
echo >&2 "error: missing output files" | ||
exit 1 | ||
fi |
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 look at refactoring these funcs in a follow-up
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.
Yup, have avoided making too many changes since #1296 refactors around this as well.