gabrieldemarmiesse / python-on-whales

An awesome Python wrapper for an awesome Docker CLI!
MIT License
543 stars 101 forks source link

buildx bake missing --metadata-file argument #504

Open pbecotte opened 10 months ago

pbecotte commented 10 months ago

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?

gabrieldemarmiesse commented 10 months ago

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

pbecotte commented 10 months ago

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: @.***>