Skip to content
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

support metadata file with call flag for build and bake commands #2640

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

crazy-max
Copy link
Member

Atm when using --call or --check, the metadata file is not generated:

$ docker buildx build --call check --file ./test/bad.Dockerfile --metadata-file md.json ./test
...
  12 |     CMD [ "echo", "Hello, Sweden!" ]
  13 |     ENTRYPOINT my-program start
--------------------

WARNING: JSONArgsRecommended - https://docs.docker.com/go/dockerfile/rule/json-args-recommended/
JSON arguments recommended for ENTRYPOINT to prevent unintended behavior related to OS signals
bad.Dockerfile:13
--------------------
  11 |     CMD [ "echo", "Hello, Norway!" ]
  12 |     CMD [ "echo", "Hello, Sweden!" ]
  13 | >>> ENTRYPOINT my-program start
  14 |
--------------------

$ cat md.json
cat: md.json: No such file or directory

I think we should allow it for build warnings related to #2551

So we can ingest call result if we want to do extra work with similar to docker/build-push-action#1197.

@crazy-max crazy-max force-pushed the call-metadata branch 4 times, most recently from e081e7d to ce21ebd Compare August 5, 2024 13:37
@crazy-max crazy-max marked this pull request as ready for review August 5, 2024 13:41
@crazy-max crazy-max added this to the v0.17.0 milestone Aug 6, 2024
Copy link
Collaborator

@jsternberg jsternberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of it seems straightforward but there was one new section I had a question about.

commands/build.go Outdated Show resolved Hide resolved
@jsternberg jsternberg merged commit 16860e6 into docker:master Aug 8, 2024
106 checks passed
@crazy-max crazy-max deleted the call-metadata branch August 8, 2024 14:46
@tonistiigi
Copy link
Member

I'm pretty sure I did this intentionally, eg. because the default exporter is cacheonly with --call, and provenance is skipped. Not 100% anymore which is better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants