-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
add support of --builder and BUILDX_BUILDER #10745
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 😻
@@ -101,6 +103,7 @@ func buildCommand(p *ProjectOptions, progress *string, backend api.Service) *cob | |||
cmd.Flags().BoolVar(&opts.pull, "pull", false, "Always attempt to pull a newer version of the image.") | |||
cmd.Flags().StringArrayVar(&opts.args, "build-arg", []string{}, "Set build-time variables for services.") | |||
cmd.Flags().StringVar(&opts.ssh, "ssh", "", "Set SSH authentications used when building service images. (use 'default' for using your default SSH Agent)") | |||
cmd.Flags().StringVar(&opts.builder, "builder", "", "Set builder to use.") | |||
cmd.Flags().Bool("parallel", true, "Build images in parallel. DEPRECATED") | |||
cmd.Flags().MarkHidden("parallel") //nolint:errcheck |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very unrelated, but if this flag is deprecated, should this use MarkDeprecated()
? (are we still using the value anywhere?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do a dedicated PR for this one 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Definitely not in this PR (my eye just dropped on it .. well.. as always 😂)
12cf2f4
to
bcc1974
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but shall we also introduce a builder
attribute in the compose specification?
Would that be very useful? If we'd add such an option, I think it'd make more sense to describe the properties of the builder instead of the name of the builder. Currently it's somewhat similar to Perhaps we need to resurrect some of the concepts from |
It would indeed be nice there's some way to describe a builder so that we can inspect the available ones and select a good match, but afaik we only can rely on a name. Also, I can imagine it will become quickly boring for a user to pass |
That's where the env var would be for? ( |
Yes, that's something to look into I guess. I'm still not sure if hard-coding it in the project's config would make sense (as it's effectively hard-coding your current environment into the project, which seems better to handle separate). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, it'd be nice to have the flag available on up
as well, but logic LGTM!
bcc1974
to
bdd3757
Compare
I'm not sure we should add this flag to the |
bdd3757
to
f45c5cb
Compare
Agree advanced build options should be limited to |
Signed-off-by: Guillaume Lours <[email protected]>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## v2 #10745 +/- ##
==========================================
+ Coverage 59.09% 59.10% +0.01%
==========================================
Files 115 115
Lines 9844 9850 +6
==========================================
+ Hits 5817 5822 +5
Misses 3436 3436
- Partials 591 592 +1
☔ View full report in Codecov by Sentry. |
f45c5cb
to
28301fb
Compare
What I did
Add
--builder
flag tobuild
command and support of theBUILDX_BUILDER
env variable to support choose dedicated builder.Should address #10664 until a proposal is discussed in the Compose specification
Related issue
N/A
(not mandatory) A picture of a cute animal, if possible in relation to what you did
