For the updating procedure you can use Ansible. https://docs.ansible.com/ansible/latest/collections/community/general/apk_module.html And for caching packages you could set up a local mirror, cache the via squid, etc.
Linux
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
If you are set on continuing to use LXC, then ansible, puppet, salt, or chef would be the first step. That at least gets you to dip your toes into configuration management, and if you're familiar with that the later parts will become more familiar.
Longer term you should consider moving to OCI containers and runtimes (eg docker or podman). It will feel like a big leap and you'll question certain ways things are done (I should know, I did it myself years ago) but if you approach it with an open mind and give it a chance you'll find that it lets your shift left on the maintenance issues you'll be dealing with. For example with your second question, you update your base image, then build your service containers on top of that. Update once, use everywhere.
-
Yes, Ansible would work for this. See the apk module. https://docs.ansible.com/ansible/latest/collections/community/general/apk_module.html
-
Yes, you could run a caching HTTP proxy, or your own mirror and set your VMs to use it.
I would recommend looking into docker and/or Kubernetes, though. It would solve these problems in a much more automated way.