Making your own operating system with bootc
Containerizing web applications is standard practice these days, but deploying your entire operating system as a container image fundamentally changes how you interact with and manage your system. If you have been exploring the cloud-native ecosystem, you have likely heard of the bootc and ostree projects. But what exactly do they do, and why should you care?
First, let’s talk about what bootc is ?
Bootc (bootable containers) fundamentally changes how we operate our OS. Instead of just spinning up containers on top of a traditional host, you practically boot into and live inside one.
Operating systems built this way are inherently immutable, meaning you cannot write directly to the root directory (/). While this might sound restrictive at first glance, it provides massive advantages for system security, predictability, and stability.
Why an immutable, container centric OS?
A bootc based OS gives you very little headroom to break your system. It is not a drill you tried some tinkering with and suddenly the system refuses to boot. If you were still able to break it, no worries — because your system treats itself as a version-controlled system:
- Atomic upgrades: Updates download in the background and unpack in parallel to the running system without interrupting your work. It is either successful or failed — no in-between state.
- Instant rollbacks: If a bad update or regression ever slips through, you can instantly roll back to the previous working deployment with a simple reboot.
There are also excellent templates and tooling built around bootc, such as BlueBuild, which has a fantastic community. Because your OS is essentially a container image, you can customize it, build, and distribute it via a container registry.
Creating and Sharing Custom ISOs
Building your own container image is straightforward, but what if you want to use it on your machine? You can’t directly install a container image on a new system.
Should you be re-basing to your image after installing CoreOS? No — then why write recipes to mend your own OS?
BlueBuild gives you an option to generate your own ISO files with blue-build generate-iso, but creating that on your machine is a lot of work. So we are going to delegate that to GitHub Actions, but there remains a catch: GitHub allows release assets up to 2 GB per file, which is often too small for full OS ISOs.
Alternative storage options include object storage like S3, but there is an egress ingress cost associated, and paying money for a small hobby is a big no-no. Services like Gofile.io can be great options for storing and sharing ISO files.
Be gentle with GitHub-hosted runners — the whole process can be computationally expensive
Here is an example of my resource consumption:
You can check out the repository building these ISOs here: Pratyay360/blueee-os.
Recommended Base Images for Customization
If you are looking to start building your own custom bootc images, here are popular upstream base image registries:
| Distribution | Base Image Registry |
|---|---|
| Fedora | fedora-ostree-desktops |
| AlmaLinux | almalinuxorg |
| CentOS Stream | centos-bootc |