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

delegate build to buildx bake #12300

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

ndeloof
Copy link
Contributor

@ndeloof ndeloof commented Nov 15, 2024

What I did

introduce support for COMPOSE_BAKE to opt-in for build to be delegated to buildx bake. Compose generates a bake json config from application model and executes bake, which (we assume) better knows how to orchestrate build steps for best efficiency.

Related issue

(not mandatory) A picture of a cute animal, if possible in relation to what you did

return imageIDs, err
}

if b, ok := os.LookupEnv("COMPOSE_BAKE"); ok {
Copy link
Member

@thaJeztah thaJeztah Nov 15, 2024

Choose a reason for hiding this comment

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

Perhaps could also be worth (if compose reads the cli config) to consider either an option in features, or plugins (plugins allows plugin-specific options to be set), which would allow opt-in/opt-out of this without having to use an env-var;
https://github.com/docker/cli/blob/9861ce90fd6b8ddca19db5f803dcbef9a583e9e1/cli/config/configfile/file.go#L42-L44

	Plugins              map[string]map[string]string `json:"plugins,omitempty"`
	Aliases              map[string]string            `json:"aliases,omitempty"`
	Features             map[string]string            `json:"features,omitempty"`

(in addition to an env-var probably)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we never used this mechanism in the past for optional/experimental docker compose features

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, my thinking here was that the cli-config would more easily allow this to be set as a default, which could also allow (e.g.) it to be set through docker desktop "settings".

@ndeloof ndeloof requested review from a team and glours and removed request for a team November 15, 2024 16:57
@ndeloof ndeloof force-pushed the delegate_build branch 2 times, most recently from cbc02f6 to 84fad3d Compare November 18, 2024 08:52
Signed-off-by: Nicolas De Loof <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants