-
Notifications
You must be signed in to change notification settings - Fork 443
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
Random LABEL snp-multi-stage-id invalidates docker cache #1325
Comments
@ppiotrow I think I can live with a deterministic label. Actually there was a discussion already if we should use a random id (like we do now) or something more deterministic. Please have a look the comment here and also my answer. As you can see my main argument was that I wanto to avoid any side effects if possible. E.g. creating an image fails and a user may want to inspect it later, however if you now run another build and that succeeds, with a deterministic label, it will also delete the previous build image, which we wanted to keep actually. |
I like the existing idea to have two layers: The caching capabilities, having reproducible (non random) builds, simpler unit tests is better from my point of view. I'd like to learn someone else with different CI setup opinion. |
@ppiotrow Let's just change |
If you can live without those labels, it's possible to simply remove then as a workaround dockerCommands := dockerCommands.value.filter {
case Cmd("LABEL", args @ _*) => args.head.startsWith("snp-multi-stage")
case _ => true
} |
Thanks for the workaround! There's just a negation missing, it should be: In general I believe a deterministic id should be the default. More users are concerned with a fast build compared to ones inspecting their failed builds. |
Expected behaviour
I'm currently writing second post about docker cache efficiency on SBT.
My main focus is to use docker cache in CI environments as much as possible. Already managed great improvements but there is problem with random generated Labels.
Executing second command always invalidates cache which is not always expected.
Especially when
dockerAutoremoveMultiStageIntermediateImages := false
is used.I suggest to use something deterministic like
stage0-(packageName in Docker).value
Actual behaviour
As you can see cache works with the first label, but gets invalidated after second, random label.
@mkurz What do you think about deterministic label?
The text was updated successfully, but these errors were encountered: