Add support for Docker Layer Caching on GitHub Actions
The GitHub Actions could support Docker Layer Caching so that users can save time and processing power when building fuzzers.
Such feature could be:
a) Native - the entire caching is abstracted and exposed as a boolean flag (i.e. docker-cache-image).
b) Partial - allow users to set a value for --cache-from to be using on docker build commands via a new input (i.e. docker-cache-from).
Would this be something the maintainers would be keen on? If so, I am happy to propose a PR.
Is this for ClusterFuzzLite/CIFuzz or OSS-Fuzz?
@jonathanmetzman this was for OSS-Fuzz CIFuzz build GitHub action. The reason I raised this was to speed up the build process, as in some cases we were experiencing north of 12 minutes for that step.

However, any other recommendations on speeding up that build process would also be appreciated.
I think I'd probably accept a PR for this if you want to write one. Can you link me to that workflow run? I want to inspect the logs and see if I can find any interesting bottlenecks. I never implemented this earlier because I assumed the build was the limiting factor in most cases
This would be extremely welcome. I'm adding CIFuzz right now, and the build time is pretty crazy, as there's no caching. See https://github.com/gravitational/teleport/runs/7688002902 for an example.
Some resources to review:
- https://evilmartians.com/chronicles/build-images-on-github-actions-with-docker-layer-caching
- https://github.com/marketplace/actions/docker-layer-caching (seems unmaintained)
- https://depot.dev/blog/docker-layer-caching-in-github-actions
- https://mmeendez8.github.io/2021/04/23/cache-docker.html
FWIW I tried this docker caching solution a few months ago
- https://github.com/ScribeMD/docker-cache/issues/304
The Action looked good but the image I need is just too big (12G) and it hit some hard github limits so I gave up.
My 2 cents, sorry if off-topic.