Using APT cache for faster instance custom bootstrapping

I enjoy using cloud-init to bootstrap my Debian/Ubuntu instances, mostly to install dozens of packages, but primarily to standardize my setup.

It works best with Incus, which simplify my life, with its cloud-init-ready profiles.

But having standardized instances means to download the same set of packages over and over again, which is time consuming, if not bandwidth limiting.

So, here’s come the joy of APT package caching proxy. And I want to share my setup here.

Let me know your opinion.

https://gitlab.com/-/snippets/4913258

4 Likes