-
Notifications
You must be signed in to change notification settings - Fork 602
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
Caching packages and images on the lima host #397
Comments
This comment has been minimized.
This comment has been minimized.
The following doesn't really work for your package/image cache, and I think configuring a mirror via a provisioning script may be the right thing to do. But if you packages/images are available in a single downloadable tarball, then it might work:
My idea for this has been to extend the mounts:
- location: /mnt/cache
from: "{{.Home}}/Library/Cache"
writable: false And then extend One complication is that Once you can specify source and destination separately, |
It might actually be better to provide an upstream VM image that has all the packages and images in that case, because there are no such tarballs (unless you create them yourself). Upstream is relying on
The proxy servers would be neat, but I'm not sure how much hassle it would be to configure them. I don't mean so much starting them on the host, but translating and applying them to configuration from the cidata or similar startup scripts ? |
It depends on the use case. E.g. for
I think this is outside the scope of lima, and should be provided by a project wrapping lima for a particular use case/scenario (like Rancher Desktop or colima do). |
This comment has been minimized.
This comment has been minimized.
I guess most normal people don't set up and tear down the same configuration over and over... Just missed the "cachier". |
I'm wondering if snapshots could be a solution to this that is maybe inside the scope of lima? |
Snapshots could be used as a workaround, or one could use custom VM images (like lima-alpine does). |
Currently lima has support for caching VM images, and for caching built-in container runtimes (i.e. containerd/buildkitd)
What would be the best way to cache "other" binaries ? Mount a directory and use a custom script ? Run a local proxy ?
The use case was from the kubernetes example, where it does a kubeadm package installation and uses k8s.gcr.io images.
Question
Could there be some new option in the yaml, to help out with caching ?
Currently I just copy the deb packages, and load images from archive...
233M /var/cache/kubeadm/amd64/kubernetes-v1.22.3-images.tar
limactl shell k8s sudo nerdctl -n k8s.io load
There is some support for setting a http_proxy/https_proxy in the environment, maybe similar for apt and containerd ?
So that one could use a local pull through cache, and run this server on the host or in the local network somewhere.
/etc/apt-cacher-ng/acng.conf (on host)
/etc/apt/apt.conf.d/proxy.conf (in lima vm)
/etc/apt/sources.list.d/kubernetes.list (in lima vm, as a workaround for not being able to cache https urls)
That is:
s|https://|http://HTTPS///|
/etc/docker/registry/config.yml (on host)
/etc/containerd/config.toml (in lima vm)
Assuming a rewrite of "localhost" (127.0.0.1) to gateway (192.168.5.2)
Or something more generic, like: https://github.com/fgrehm/vagrant-cachier
The text was updated successfully, but these errors were encountered: