Caching OS-Images inside home-network possible?

Hi there,

I’ve been asking me for quite a while now.
Since my brother thinks about making the switch to Linux from Win11 and he isn’t the type for tinkering, I’ve been more and more convinced, that Bazzite would be the right choice for him.
(I’ve been daily-driving Arch for a few years now, so he would not be thrown into cold waters when coming newly over to Linux. I promise, I’ll hold his hands until he’s settled and comfortable :grinning_face_with_smiling_eyes: )

I’ve been trying on a separate disk now and have noticed, that the update-procedure is kind of… slow?

When I’ve updated the system manually via the ujust utility, I saw that the OS-Image got downloaded from ghcr, which’s backend is afaik fastly CDN.

I’ve read some reports, that fastly’s CDN tends to be everything else than fast.

So, I’ve been looking up the net, browsing the directories of Bazzite and tearing the OS apart to just find a clue: Is it possible, to somehow cache OS-Images on my homelab-server?

The idea behind all that is, that my homelab-server is running 24/7 and it could download the OS-images and store them on the disk, for example keeping only the latest version, so that PC’s inside my home-network can grab the OS-image from my homelab-server, instead of downloading it from the net. (I have a 10GBit/s uplink from my ISP, but our PC’s are each connected via 1GBit/s to my MikroTik Router. That would still not be the problem though, if the bottleneck is fastly’s CDN)

That could be everything, e.g. the PC of my brother, a future self-built steam-machine, etc.

Has anyone ever done that? Is that even possible?
If so, how could I setup an image mirror on my server and configure Bazzite to grab the images from it, instead from ghcr?

If not: Would this be a viable Feature Request, if it’s even possible to achieve?

Thanks and Cheers

1 Like

The solution (I think) is to run a pull-through cache (registry mirror) on a server at home.

I’ve never run one though. This is just some googling I did.

2 Likes

I guess yea, that’s kind of a first part of the infrastructure.
When utilizing the registry container image, I might be able to pull the image from ghcr and push it to my local registry.

Now the only question remaining is, if Bazzite has the ability to let it’s remote registry be configured.

Thanks for the hint with the pull-through cache

Danathar is correct, you can run a transparent registry, options include harbor, zot, and the docker registry.

If configured correctly this can also handle brew packages as well. I don’t think anyone has documented the client side changes needed, but ideally it’d be nice if it was an autodiscover thing that didn’t need client config. Someone would need to sort out the details and document it.

1 Like

I see why you’ve mentioned brew, after I read one of your blog-posts.

That’s an interesting thought you’ve got there. I knew that homebrew got some Linux packages, but never imagined how powerful they could be on an immutable OS like Bazzite. :thinking: Maybe that tought’s coming because I’ve never got warm with immutable OS’ since being an Arch user for Desktop and Alpine for Server :sweat_smile:

Well, I definitely will keep it as an option, if it ever comes so far. I think my brother won’t be much of a CLI user :face_savoring_food:

If Bazzite was indeed capable of detecting a mirror inside the local network and prefer it that way, that surely would be a sweet thing to have. I think I’ll start looking through the OS again and see what I can find.

1 Like

What does immutability have to do with any of this lol?

Partially immutable :wink: I know it’s a losing battle with this. It’s just stuck in people’s minds!

Well, I was more reffering to having the ability to install CLI-tools, which get installed in userspace like homebrew does.

On a mutable distro e.g. Fedora itself, I’d never think of using homebrew to install cli-tools, when the official repo have them available.

But this is my personal opinion and this discussion would get off-topic.

1 Like

The more I learn.

Thanks for the heads up. :wink:

1 Like

I’m not really trying to correct people… well… :wink: That would be a bit pretentious on my part. I do think, though, that people say “immutable” and think “I can’t change stuff” when that’s just not true. You can, just in a different way. I see that argument with people who REALLY don’t like the Atomic distributions. Their arguments usually start off with that bit of misunderstanding.

1 Like

I see that argument with people who REALLY don’t like the Atomic distributions.

Do people really argue about this? The overwhelming majority of linux client devices are this way.

I think the people who dislike it are “legacy” desktop Linux users that have been using Linux for a long time (old guys… like me!). You know, stuck in old ways of doing things. You are totally right, though—that’s the way Android does it… as an image (I think?).