Openfire icon indicating copy to clipboard operation
Openfire copied to clipboard

Improve docker caching

Open dwd opened this issue 8 months ago • 0 comments

The goal here is to ensure that docker rebuilds are fast, and especially so when inside CI.

This PR achieves this by two methods:

Using build-time cache mounts to handle the Maven repository. These are held independent of the "hash", so can persist (or not) between builds even if the calling hash changes. In our case, this means that if the pom.xml files change, we may reuse an "old" Maven repo and just fetch the changes.

Having the docker engine upload the docker cache (which includes the above, and also layers) to Github's cache API, and restore it prior to a build.

Tested by:

Enabling the docker build for this branch, and disabling push. Forced a rebuild which executed very quickly. This is as far as I think we can go at this stage. Realistically, I would expect this to be a step on the way, rather than the endpoint solution, because we'll learn more. There may be a way of reusing the maven repo from the first CI stage build, for example, but this will need to wait.

dwd avatar Jun 09 '25 11:06 dwd