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
Add --metadata-file flag to output build metadata #2095
Conversation
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.
LGTM but can you add a test. You can also modify an existing test and add an extra check.
@tonistiigi Sure I can try to add something. Also, do you understand the test failure here? Not sure how these changes would have affected it.
|
@tonistiigi Actually, I took a look at the existing unit tests. They are pretty complicated, so I'm not entirely sure what I'm supposed to do. Can you provide some additional guidance on this? |
You can base it on https://github.com/moby/buildkit/blob/master/client/client_test.go#L1783-L1821 for example. No need to push in your case. |
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.
On second look, I wonder though if client pkg is the correct place for it. Solve
already returns this value so it is kind of duplicated to have side-effect and write it to a file in there as well. I think it might be more suited directly in buildctl
pkg.
Signed-off-by: Jesse Rittner <rittneje@gmail.com>
@tonistiigi Apologies for the churn. I was not able to run the tests locally before due to docker/cli#2989. The test I added is passing now. |
Output build metadata (such as image digest) to a file based on a flag to
buildctl
.Fixes #1158.
@tonistiigi @AkihiroSuda This is based on the comments from #1315.