Local package cache? #42
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi!
debootstrap
has an option to cache downloaded packages:--cache-dir=/var/cache/apt/archives
This caches downloaded packages on the host (not in the "guest"), which speeds up consecutive bootstrap runs.
Does
mmdebstrap
has some way to achieve a similar effect?What the debootstrap
--cache-dir
option does is a layer violation. You have at least two options to do something similar in mmdebstrap:If you go the first route, feel free to share your scripts. If they are general-purpose enough I can include them in the
hooks
directory so that others can make use of them as well.Hm, instead of copy-in and copy-out, I would just bind-mount the directory. But then it has to be unmounted if the process is interrupted due to an error or a SIGINT. Oh, I see the docs; if at some point it installs everything in that directory, then this wouldn't work...
OK, that's fine, I was just wondering if there is already a solution I couldn't find. (Maybe the
--cache-dir
option should be added to the list of "debootstrap options that don't exist" in the readme file?)No, mmdebstrap creates its own mount namespace, so everything gets unmounted automatically even if you should forget to unmount or if the process dies early. Have a look in
/usr/share/mmdebstrap/hooks/file-mirror-automount
for inspiration how an externalfile://
repository can be auto-mounted.Also, you really should not mess with
/var/lib/apt/archives
. That directory is an implementation detail of apt and only apt should operate on it.The best solution is really to set up a local apt proxy. There are various solutions to that problem so mmdebstrap does not have to add its own thing.