build: add no-cache-filter#860
Conversation
|
Should be added to compose with the Line 119 in 5c2b9bb |
d75525d to
e09d19d
Compare
|
Silly (?) idea; would it work if, instead of adding an additional flag, we would allow --no-cache (no args) same as today (disable all caches) |
|
@thaJeztah No, I don't think this is possible. Even with some crazy hack (that is not worth the maintenance cost) to flag parsing, it is ambiguous to positional args in some cases. Theoretically, if we wanted we could deprecate the old flag and add something that signifies "all stages" to new flag. But I think the current flag is already too common. |
|
@thaJeztah sgty? |
Hm.. yeah, it may be tricky to implement it (with the positional args). I was curious if we wouldn't already be in this situation with mkdir true
echo "FROM busybox" > true/Dockerfile
docker build -t foo true
[+] Building 0.1s (5/5) FINISHED
...
docker build -t foo --no-cache true
[+] Building 0.1s (5/5) FINISHED
...But it looks like (unlike for other type of flags?) boolean flags require values to be passed with docker build -t foo --no-cache true true
"docker build" requires exactly 1 argument.
See 'docker build --help'.
docker build -t foo --no-cache=true true
[+] Building 0.1s (5/5) FINISHED
... |
|
So the "short answer" is that I don't really like As to deprecating Irregardless of what we choose in that respect, I think we should consider making them mutually exclusive, and print a conflict error if both is used. Looking at (e.g.) this example from moby/buildkit#1213:
Looking at that example, I don't think the |
|
One more thing I observed in the examples from that ticket;
Less of a strong opinion on that, but I recall at some point, we "deprecated" some syntaxes that used a colon ( --no-cache-filter mount=id1Also wondering; if the above is to "use all cache mounts, except for mount --no-cache-filter !mount:id1If we'd go for --no-cache-filter mount!=id1(which feels the 'natural' thing to do), but if we want parsing to be handled using the "csv" notation used elsewhere, I guess the "correct" way would be; --no-cache-filter mount=!id1Which, hm, would be a bit awkward as well (overall, the double negative is a bit hard to grasp; |
|
@thaJeztah What changes are you asking? I can't implement I don't think |
|
ping @thaJeztah |
|
I have a use case for that one 🙂 |
|
As discussed;
|
e09d19d to
fea32fe
Compare
fea32fe to
e491eb9
Compare
|
@thaJeztah PTAL |
Signed-off-by: Tonis Tiigi <[email protected]>
Signed-off-by: Tonis Tiigi <[email protected]>
Per review request. Signed-off-by: Tonis Tiigi <[email protected]>
e491eb9 to
eb8057e
Compare
|
@tonistiigi Hello, not sure where the right place to ask this is, but I am unclear on what to provide as an argument to the |
|
@taranlu-houzz you need to move your step to a separate stage to skip second:
|
|
Hmm, I see. Okay, I will try that out. Is this documented anywhere? I am new-ish to |
Allows specifying the
no-cacheper stage. Partially implements moby/buildkit#1213