buildah icon indicating copy to clipboard operation
buildah copied to clipboard

[RFE]: Add support for `buildx bake` command

Open vially opened this issue 1 year ago • 17 comments

Docker supports higher-level builds using the buildx bake command. The command introduction page provides a good overview about the use-cases enabled by this command:

Buildx also aims to provide support for high-level build concepts that go beyond invoking a single build command. We want to support building all the images in your application together and let the users define project specific reusable build flows that can then be easily invoked by anyone.

BuildKit efficiently handles multiple concurrent build requests and de-duplicating work. The build commands can be combined with general-purpose command runners (for example, make). However, these tools generally invoke builds in sequence and therefore cannot leverage the full potential of BuildKit parallelization, or combine BuildKit’s output for the user. For this use case, we have added a command called docker buildx bake.

Personally, I'm mostly interested in this command because it allows getting rid of various hackish scripts and make files and replaces them with a single command: buildah builx bake.

That being said, the command is still experimental in Docker and has a pretty big API surface (lots of flags and config options) so it might not be trivial to support it in buildah. But I think even a simplified version of this command that only covers the basic stuff could still provide a lot of value to buildah/podman users.

vially avatar May 16 '23 19:05 vially

Sure interested in opening some PRs to start building it.

rhatdan avatar May 18 '23 21:05 rhatdan

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] avatar Jun 18 '23 00:06 github-actions[bot]

Can't resist a joke. But since Docker does not support this, does that mean it is half baked? :^)

rhatdan avatar Jun 20 '23 20:06 rhatdan

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] avatar Jul 21 '23 00:07 github-actions[bot]

How does one specify what you want to bake? Multiple Containerfiles?

rhatdan avatar Jul 24 '23 14:07 rhatdan

here is a good example of its usage: https://github.com/crazy-max/xgo#build

git clone https://github.com/crazy-max/xgo.git xgo
cd xgo

# Build xgo image and output to docker with xgo:local tag
docker buildx bake

# Tests
BASE_IMAGE=xgo:local docker buildx bake test-c
BASE_IMAGE=xgo:local docker buildx bake test-cpp
BASE_IMAGE=xgo:local docker buildx bake test-gorm

# Create xgo artifacts in ./dist
docker buildx bake artifact-all

gedw99 avatar Aug 14 '23 13:08 gedw99

@flouthoc PTAL

rhatdan avatar Aug 14 '23 18:08 rhatdan

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] avatar Sep 14 '23 00:09 github-actions[bot]

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] avatar Oct 17 '23 00:10 github-actions[bot]

@umohnani8 We might want to look at something like this after podman farm build.

rhatdan avatar Oct 17 '23 17:10 rhatdan

Wouldn't it make sense to point buildkit to the podman socket at some point? I fear it's not that sustainable to chase buildkit which is evolving very rapidly. Similar to podman compose, a hypothetical podman buildx would call buildkit but point it to the podman socket.

That would allow to focus on the REST API.

vrothberg avatar Oct 18 '23 07:10 vrothberg

watching this.

kmf avatar Oct 29 '23 07:10 kmf

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] avatar Dec 15 '23 00:12 github-actions[bot]

Great feature, we have a pipeline to build 20+ targets, it will help

sword-jin avatar Dec 26 '23 04:12 sword-jin

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] avatar Jan 26 '24 00:01 github-actions[bot]

Also find this one valuable. We have functionality relying on docker buildx Bake and we'd like to move to Buildah and Podman but have been hesitant due to this lack of functionality.

Cjewett avatar Mar 11 '24 15:03 Cjewett