Skip to content

Enable cache-from support for GHA cache options#1599

Merged
djmb merged 1 commit intobasecamp:mainfrom
martinzamuner:builder-options-for-cache-from
Nov 7, 2025
Merged

Enable cache-from support for GHA cache options#1599
djmb merged 1 commit intobasecamp:mainfrom
martinzamuner:builder-options-for-cache-from

Conversation

@martinzamuner
Copy link
Contributor

Previously, cache options were only passed to cache-to, not cache-from. This PR updates the builder to pass allowed options to cache-from as well. Specifically:

  • url
  • url_v2
  • token
  • scope
  • timeout

Reference: https://docs.docker.com/build/cache/backends/gha/#synopsis

@djmb
Copy link
Collaborator

djmb commented Aug 11, 2025

Can we assume that you would always want to pass the same values to both cache-to and cache-from?

Maybe it would be better to have something like:

options:
  cache-to:
    ...
  cache-from:
    ...

We could keep passing options not under cache-to/cache-from to cache-to for backward compatibility.

@martinzamuner
Copy link
Contributor Author

I think it's pretty safe to assume that.

url, url_2 & token are used for auth with the cache server, which needs to be the same for read/write.
scope is basically the key for such read/write, can't think of a good reason to use different keys.
timeout could maybe benefit from different values, but a priori seems overkill.

I might be missing something, though. Happy to apply your suggestion if you prefer.

@djmb djmb merged commit befce1a into basecamp:main Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants