porter-archive icon indicating copy to clipboard operation
porter-archive copied to clipboard

feat: use gha cache exporter when building via buildkit

Open jose-fully-ported opened this issue 1 year ago • 0 comments

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

jose-fully-ported avatar Dec 14 '23 16:12 jose-fully-ported