porter-archive
porter-archive copied to clipboard
feat: use gha cache exporter when building via buildkit
What does this PR do?
Buildkit builds expose custom cache exporters which can be used to locally speed up builds on Github Actions. The gha cacher will use the Github Actions cache api instead of the remote registry for caching.
To enable this, set the following two environment variables.
DOCKER_BUILDKIT=1
BUILDKIT_CACHE_EXPORTER=gha
Note that the cache mode is set to min by default (no value == min) due to a potential timeout issue within the exporter. See https://github.com/moby/buildkit/issues/2276 for details. To switch the cache mode, set the following environment variable:
BUILDKIT_CACHE_MODE=max