Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to efficiently cache docker layer in CI with kbld? #208

Open
StarpTech opened this issue Dec 24, 2021 · 6 comments
Open

How to efficiently cache docker layer in CI with kbld? #208

StarpTech opened this issue Dec 24, 2021 · 6 comments
Labels
helping with an issue Debugging happening to identify the problem

Comments

@StarpTech
Copy link
Contributor

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 #43

@StarpTech StarpTech added the carvel triage This issue has not yet been reviewed for validity label Dec 24, 2021
@pivotaljohn
Copy link
Contributor

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.

@pivotaljohn pivotaljohn added helping with an issue Debugging happening to identify the problem and removed carvel triage This issue has not yet been reviewed for validity labels Jan 4, 2022
@StarpTech
Copy link
Contributor Author

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.

@cppforlife
Copy link
Contributor

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)?

@StarpTech
Copy link
Contributor Author

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.

@cppforlife
Copy link
Contributor

@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)

@cppforlife
Copy link
Contributor

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.

@aaronshurley aaronshurley moved this to To Triage in Carvel Jul 25, 2022
@github-project-automation github-project-automation bot moved this to To Triage in Carvel Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
helping with an issue Debugging happening to identify the problem
Projects
Status: To Triage
Development

No branches or pull requests

3 participants