#cache busting without changing code

1 messages · Page 1 of 1 (latest)

earnest osprey
#

I take it you're familiar with the set-a-random-value-as-an-env-var pattern, and want a way to do that without changing code?

#

If so the answer is no, we've thought about better ways to control cache busting, but it's been somewhat low priority since there's a not-too-terrible workaround (WithEnvVariable("NOW", time.Now().String()))

#

It's possible to tell Buildkit to ignore caches, but the downside is right now that will also ignore explicit cache volumes, which doesn't seem like something you'd want all the time. The $NOW approach is better in that regard. (Also Dagger doesn't expose that Buildkit param.)

#

One thing you could do is parameterize a cache buster value and just give it a stable default. That way it'll cache by default, and you can re-run with a different cache buster value.

#

Aside from that, there's been talk of a dagger engine prune (or something) to manually reap caches