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

export and import --mount=type=cache caches #1474

Closed
databus23 opened this issue May 6, 2020 · 4 comments
Closed

export and import --mount=type=cache caches #1474

databus23 opened this issue May 6, 2020 · 4 comments

Comments

@databus23
Copy link

I'm wondering if its possible to save and restore cache mounts. I'm running buildkit in a CI environment where consecutive build of tasks are executed on different worker nodes.
The current --import-cache/--export-cache feature only seems to work on on the resulting layers but does not include the cache mounts.
Is there a way to export and import those cleanly?

@Norbo11
Copy link

Norbo11 commented May 11, 2020

Also very interested in this - we want to have our CI builds running on Kubernetes pods, and also have the Dockerfiles take advantage of the experimental --mount=cache syntax in order to cache the application's dependencies. However, it's currently unclear how to have our ephemeral pods use such a shared mount on our cluster - I imagined a solution involving PersistentVolumeClaims, however it's unclear how to export/import such cache volumes managed by BuildKit.

@jvanbruegge
Copy link

Yes, I just had this issue too with GitHub Actions. As a workaround is it save to cache /var/lib/docker/buildkit/cache.db and is that enough?

@Mahoney
Copy link

Mahoney commented Apr 23, 2021

@jvanbruegge I don't have time to test it right now, but if you find that works could you update https://stackoverflow.com/questions/60448114/how-do-i-reuse-the-cache-from-a-run-mount-type-cache-docker-build with that as an answer?

@tonistiigi
Copy link
Member

#1512

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants