python-on-whales icon indicating copy to clipboard operation
python-on-whales copied to clipboard

buildx bake missing --metadata-file argument

Open pbecotte opened this issue 2 years ago • 2 comments

Was writing a tool that needed to run buildx bake and then run containers with the output images. Was surprised to see that the behavior of this command is different than how build is handled- it basically returns the dry-run output even when the build does happen. I was able to work around it in my own code using the same approach from the build command (inserting an extra argument in the targets array, save the metadata file in a tempdir, parse the file to return Images). I was thinking about submitting a PR, but realized that it would require changing the existing behavior.

So- would we be interested in changing the behavior of docker.builds.bake(print=False) to return a dictionary mapping of target to Image objects?

pbecotte avatar Nov 18 '23 09:11 pbecotte

If I understand your use case correctly, you use --load and want the python_on_whales.Image objects that were created, right?

gabrieldemarmiesse avatar Nov 18 '23 11:11 gabrieldemarmiesse

Yes, that's what I was trying to accomplish

On November 18, 2023, tomlucasSQL @.***> wrote:

If I understand your use case correctly, you use --load and want the python_on_whales.Image objects that were created, right?

— Reply to this email directly, view it on GitHub <https://github.com/gabrieldemarmiesse/python-on- whales/issues/504#issuecomment-1817488466>, or unsubscribe <https://github.com/notifications/unsubscribe- auth/AA6URSEQCPB6UJRKQMVL34LYFCO5DAVCNFSM6AAAAAA7Q2SCT2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJXGQ4DQNBWGY>. You are receiving this because you authored the thread.Message ID: @.***>

pbecotte avatar Nov 18 '23 23:11 pbecotte