kbld
kbld copied to clipboard
How to efficiently cache docker layer in CI with kbld?
Hi, I know kbld is builder neutral, but what's the best practice to cache docker layers in the CI? As far I know, the default docker CLI is very limited when it comes to caching. docker buildx
has much better support, but kbld doesn't support it yet https://github.com/vmware-tanzu/carvel-kbld/issues/43
Hi, I know kbld is builder neutral, but what's the best practice to cache docker layers in the CI?
There's no special pattern for caching docker layers in CI; kbld
delegates building images and is not involved in that layer, directly.
As noted in #43 (apt reference, 👍🏻 ), there's some design work left to start the integration with docker buildx. That issue is a great place to further the larger conversation. At this time, this work is not currently on the maintainer's roadmap. That said, we would be delighted and do our best to support any community efforts to do so.
Hi @pivotaljohn thanks. It would be great to hear how caching is solved in general in your experience. Especially, when kbld limits you to use just docker build
.
docker buildx has much better support, but kbld doesn't support it yet #43
@StarpTech im not versed in buildx. how does it help in this scenario? does it cache layers in a registry, and downloads it from there? how do you see kbld integration to play out here (what is the command kbld should be calling to use buildx)?
does it cache layers in a registry, and downloads it from there? how do you see kbld integration to play out here (what is the command kbld should be calling to use build)?
Basically, yes. https://github.com/moby/buildkit#cache Rebuilding all images is unusable. Especially in the CI where the storage ephemeral.
@StarpTech would you be able to share what kind of command you would-want/already to be running? (we probably need a bit more hand holding from users like you on how to integrate with buildkit)
added docker buildx build
support in https://github.com/vmware-tanzu/carvel-kbld/releases/tag/v0.34.0. you should also be able to use various caching configuration if you enable docker.build.buildkit configuration option or set env variable.