Ubuntu updates from a local repository including containers
Daniel Nashed – 29 December 2024 19:34:16
In larger companies a local repository cache could be a more efficient way to update and install packages.
Providers often have their own repositories as well.
My favorite provider Hetzner runs an own repository:
https://docs.hetzner.com/robot/dedicated-server/operating-systems/hetzner-package-mirror/#for-x86-based-servers
Servers at Hetzner have the repository pre-setup (it is only available for Hetzner servers).
Container images
But when you use a container image the standard Ubuntu repository is used.
I never looked into it. But now I am working on a project where we require local repositories.
Using a local repository is the more efficient way in this case.
I have added functionality to the container image build use an alternate repository.
But this is limited to Ubuntu LTS 24.04 (Noble) for now.
domino-container/dockerfiles/install_dir_domino/custom/ubuntu_noble.sources
Building your own local repository
Debmirror is a tool to build repositories. If you only select the main components for x64 the size is 47 GB.
https://help.ubuntu.com/community/Debmirror
The script syncs the packages and you can use for example NGINX to host the repository.
I have tested the setup with Hetzner and also with the local repository.
Does anyone have a similar requirement? What are you doing to build with a local repository?
- Comments [0]