-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
buildctl: new CLI ("Option C+") #807
Conversation
7624b91
to
808b96f
Compare
57aefd9
to
7a263e6
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.
I'm not 100% sure its a good idea but maybe we could support single value --frontend=dockerfile.v0
, --export=oci
as well if value is not csv.
Bikeshed warning: I think I find |
Good point (type vs name). I'm a bit cautious with using |
More options:
|
For frontend this would possibly still work; I don't think multiple frontends can be used on a single build? (unless I'm forgetting something). For exporter we must group them together in a single flag.
I think (should check) that in docker we made an exception for the first parameter to be positional (at least we talked about it), so: First param uses
First parameter does not have a
Invalid: both first (positional), and last (
|
The main problem atm (in addition to this being cumbersome and hard to name) is the point you brought up that |
Let's also make sure that there is a sane way to do comma separated values as they are quite common (platform,name,cache-from) and add examples for how to do it. |
|
Another options is to rather deprecate CSV and restore the legacy form (sorry for going back and forth), with support for multiple (e.g.) exporters, but not sure how it can be implemented with any existing CLI library.
|
Any counterarguments for #807 (comment) ?
I think this is acceptable if it's documented. |
I'm fine with the proposal, but just so everyone is on the same page: |
@tiborvass or escape them |
So the format would support both
and
(both being equivalent)? |
We could support both with CLI magic but the second one would just convert to the first one. In API it is a comma separated string. The proposed format is:
|
How should it work with If we focus on compatibility, the flag would be like |
|
Off-topic: do we also want to remove |
I don't think so. It would be good to figure out syntax for
? Maybe in docker it makes more sense to explicitly require There is still an option to not do the positional value in |
I'll try to update PR to support both |
And for opt? I don't think we should do |
To sum up: Should be supported
Should be supported but deprecated
Should NOT be supported
Let me know if this is not correct. |
I think it's confusing to support multiple variants together. Option AShould be supported
Should be supported but deprecated
Should NOT be supported
Option BShould be supported
Should be supported but deprecated
Should NOT be supported
Option CShould be supported
Should be supported but deprecated
Should NOT be supported
|
0df646b
to
5d970dc
Compare
See moby#807 (comment) Close moby#774 Signed-off-by: Akihiro Suda <[email protected]>
5d970dc
to
fa15e25
Compare
See moby#807 (comment) Close moby#774 Signed-off-by: Akihiro Suda <[email protected]>
fa15e25
to
b542bd0
Compare
See moby#807 (comment) Close moby#774 Signed-off-by: Akihiro Suda <[email protected]>
b542bd0
to
c587dfc
Compare
Update PR to use |
c587dfc
to
1f133d4
Compare
It's not too important but I'd rather leave the src/dest only to values where it points to a file/path and leave it to ref if it is a reference. |
@thaJeztah @tiborvass @ijc WDYT? |
@@ -122,7 +122,7 @@ During development, Dockerfile frontend (dockerfile.v0) is also part of the Buil | |||
|
|||
``` | |||
buildctl build --frontend=dockerfile.v0 --local context=. --local dockerfile=. | |||
buildctl build --frontend=dockerfile.v0 --local context=. --local dockerfile=. --frontend-opt target=foo --frontend-opt build-arg:foo=bar | |||
buildctl build --frontend=dockerfile.v0 --local context=. --local dockerfile=. --opt target=foo --opt build-arg:foo=bar |
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.
Bit on the fence on the --frontend-opt
-> --opt
change, as it's not clear to me that they are related to each other. 😅
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.
Why should you as a user care if they are related or not?
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.
To understand that an option is related to the frontend, not to (e.g.) the --output
.
If we drop the prefix, should we also drop the --export-
prefix from --export-cache
?
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 wouldn't say they are strictly related to the frontend. They are more like options for the build request, while the other options are for a specific component (exporter, cache) or are cli side (local, secret).
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.
Ah; gotcha - guess I got confused because they previously were prefixed
〉leave it to ref if it is a reference. Could you be more specific about the reason for this? |
@AkihiroSuda I'm quite sure that we can't make it into a rule that every exporter/importer will only have a src/dest option in the future. That's why its a generic map in the API. For paths, src/dest seems obvious, for refs I've not seen it before. I'm willing to change my mind though if people think the other logic makes more sense. |
1f133d4
to
a84403a
Compare
See moby#807 (comment) Close moby#774 Signed-off-by: Akihiro Suda <[email protected]>
reverted |
See moby#807 (comment) Close moby#774 Signed-off-by: Akihiro Suda <[email protected]>
a84403a
to
5c9f7b8
Compare
rebased |
Any task left? |
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, thanks!
See moby/buildkit#807 (comment) Close #774 Signed-off-by: Akihiro Suda <[email protected]>
See #807 (comment)
Fix #774
Signed-off-by: Akihiro Suda [email protected]