buildctl: new CLI ("Option C+")#807
Conversation
7624b91 to
808b96f
Compare
57aefd9 to
7a263e6
Compare
tonistiigi
left a comment
There was a problem hiding this comment.
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 <suda.akihiro@lab.ntt.co.jp>
5d970dc to
fa15e25
Compare
See moby#807 (comment) Close moby#774 Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
fa15e25 to
b542bd0
Compare
See moby#807 (comment) Close moby#774 Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
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? |
| ``` | ||
| 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.
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.
Why should you as a user care if they are related or not?
There was a problem hiding this comment.
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.
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.
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 <suda.akihiro@lab.ntt.co.jp>
|
reverted |
See moby#807 (comment) Close moby#774 Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
a84403a to
5c9f7b8
Compare
|
rebased |
|
Any task left? |
See moby/buildkit#807 (comment) Close #774 Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
See #807 (comment)
Fix #774
Signed-off-by: Akihiro Suda suda.akihiro@lab.ntt.co.jp