{
"summary": "> **Proprietor:** MiOS-DEV",
"logic_type": "documentation",
"tags": [
"MiOS",
"root"
],
"relations": {
"depends_on": [
".env.mios"
],
"impacts": []
}
}
Proprietor: MiOS-DEV Infrastructure: Self-Building Infrastructure (System Specificationl Property) License: Licensed as personal property to MiOS-DEV
MiOS is a self-replicating OS the published image can be used as the builder for the next generation. This document explains the self-build architecture and when to use each mode.
MiOS ships all the tools needed to rebuild itself: Podman, Buildah, bootc, and bootc-image-builder (BIB) are all baked into the image. This means you can boot a running MiOS system and use it to build the next version, without needing a separate build environment.
The build chain is:
MiOS v0.1.4 (running) builds MiOS v0.1.4 (OCI image)
Rechunk Sign Push to GHCR
MiOS v0.1.4 (running via bootc upgrade)
builds MiOS-NXT ...
If you are starting from a fresh Linux installation (Fedora/Debian/Ubuntu), you can bootstrap the entire MiOS build environment with a single command:
curl -sL https://raw.githubusercontent.com/MiOS-DEV/MiOS-bootstrap/main/install.sh | sudo bashThis will:
- Install system prerequisites (
git,podman,just,rsync). - Clone the latest MiOS source to
/usr/src/mios. - Symlink the system directories and install the unified
miosCLI. - Configure
tmpfiles.dfor persistent state management.
The GitHub Actions workflow automatically builds, rechunks, signs, and pushes the image on every commit to main and on a weekly schedule. This is the recommended approach for production use.
# Users receive updates via:
sudo bootc upgradeNo local build infrastructure needed. The CI runner is an Ubuntu 24.04 GitHub-hosted runner.
For local development and testing on Windows with Podman Desktop:
# Run the 5-phase orchestrator .\mios-build-local.ps1
This creates a dedicated mios-builder Podman machine, builds the OCI image, rechunks it, generates disk images (RAW, VHDX, WSL, ISO), and optionally pushes to GHCR. Phase by phase:
- Phase 0: Prompts for username, password, LUKS passphrase, registry credentials
- Phase 1: Creates the
mios-builderPodman machine (rootful, all cores, all RAM, 250 GB disk) - Phase 2: Injects credentials into
99-overrides.sh, runspodman build, rechunks, restores placeholders - Phase 3: Generates disk images via BIB (RAW VHDX, WSL tarball, Anaconda ISO)
- Phase 4: Pushes to GHCR, sets package public
- Phase 5: Restores default Podman machine, prints report
For local development on a Linux system (including a running MiOS):
# Full build just build # Build + rechunk just build rechunk # Build + all disk images just all ### Mode 4: Appliance (Ignition Builder) For fully automated, hardware-native builds on a fresh machine, you can use the Fedora CoreOS (FCOS) or Fedora Server Ignition builder: ```bash # Configuration located in: # config/ignition/mios-builder.bu # config/ignition/build-mios-iso.sh
- Customize: Edit
mios-builder.buto add your SSH key and password hash. - Compile: Use Butane to convert the
.bufile to an Ignition.ignfile. - Deploy: Provision a fresh FCOS or Fedora Server instance with the resulting Ignition file.
Upon first boot, the appliance will:
- Connect to the network.
- Install dependencies (
git,podman,just). - Automatically clone and bootstrap the MiOS build environment.
- Build a live MiOS installer ISO at
/usr/src/mios/output/mios-installer.iso.
just raw # RAW disk image just iso # Anaconda ISO just vhd # VHDX for Hyper-V just wsl # WSL2 tarball just push # Push to GHCR just lint # Run bootc container lint just clean # Clean build artifacts
### Mode 4: Self-Build (running MiOS builds next MiOS)
Boot into a running MiOS system and build from source:
```bash
# Clone the repo
git clone https://github.com/MiOS-DEV/MiOS-bootstrap.git
cd MiOS
# Build the OCI image (rootful Podman required)
sudo podman build --no-cache -t localhost/mios:dev .
# Validate
sudo podman run --rm localhost/mios:dev bootc container lint
# Rechunk for optimal delta updates
sudo bootc-base-imagectl rechunk --max-layers 67 \
localhost/mios:dev \
localhost/mios:rechunked
# Test locally: switch to the locally-built image
sudo bootc switch --transport containers-storage localhost/mios:rechunked
sudo systemctl reboot
If you're starting from scratch (no existing MiOS image):
- Install Podman on any Linux system (Fedora, Ubuntu, etc.) or use Podman Desktop on Windows
- Clone the repo and run
podman build(ormios-build-local.ps1on Windows) - The Containerfile pulls
quay.io/fedora/fedora-bootc:rawhideas the base no prior MiOS image needed - Deploy the resulting image to your target (bare metal via ISO, Hyper-V via VHDX, etc.)
- Subsequent builds can use the running MiOS itself (self-build mode)
To confirm that a running MiOS image can build the next generation:
# Check required tools are present which podman buildah bootc bootc-image-builder # Check Podman can build (rootful) sudo podman info | grep -E "rootless|graphRoot" # Check disk space (need ~50 GB free for build) df -h /var/lib/containers # Test a minimal build sudo podman build --no-cache -t test-build . && echo "Self-build: OK" sudo podman rmi test-build
| Resource | Minimum | Recommended |
|---|---|---|
| CPU cores | 4 | 8+ |
| RAM | 8 GB | 16+ GB |
| Disk (builder) | 100 GB | 250 GB |
| Network | Required (pulls base image + packages) | Fast connection for RPM downloads |
The bootc-image-builder (BIB) tool is currently used for generating disk images. However, the image-builder-cli is an emerging alternative with advantages such as SBOM generation and cross-architecture support.
Actionable Item: Evaluate image-builder-cli as a potential successor to BIB.
- Current Status:
image-versions.ymlhas commented-out entries forimage_builder_cli_digest, indicating an intention to track this tool. - Next Steps:
- Uncomment and populate
image_builder_cli_digestinimage-versions.ymlto enable Renovate Bot for version management. - Investigate the
ghcr.io/osautomation/image-builder-cli:latestcontainer image as a potential replacement for the BIB container. - Compare output formats and build times against current BIB usage.
- Assess its compatibility with MiOS's existing build pipeline and testing infrastructure.
- Uncomment and populate
This evaluation should be conducted before considering a full migration.
The bootc-image-builder (BIB) tool is currently used for generating disk images. However, the image-builder-cli is an emerging alternative with advantages such as SBOM generation and cross-architecture support.
Actionable Item: Evaluate image-builder-cli as a potential successor to BIB.
- Current Status:
image-versions.ymlhas commented-out entries forimage_builder_cli_digest, indicating an intention to track this tool. - Next Steps:
- Uncomment and populate
image_builder_cli_digestinimage-versions.ymlto enable Renovate Bot for version management. - Investigate the
ghcr.io/osautomation/image-builder-cli:latestcontainer image as a potential replacement for the BIB container. - Compare output formats and build times against current BIB usage.
- Assess its compatibility with MiOS's existing build pipeline and testing infrastructure.
- Uncomment and populate
This evaluation should be conducted before considering a full migration.
| Resource | Minimum | Recommended |
|---|---|---|
| CPU cores | 4 | 8+ |
| RAM | 8 GB | 16+ GB |
| Disk (builder) | 100 GB | 250 GB |
| Network | Required (pulls base image + packages) | Fast connection for RPM downloads |
The build process downloads ~2-4 GB of RPM packages from Fedora repos, RPM Fusion, Terra, and CrowdSec. Subsequent builds with dnf5 cache mounts are 5-10x faster.
- Core: containers/bootc | bootc-image-builder | bootc.pages.dev
- Upstream: Fedora Bootc | CentOS Bootc | ublue-os/main
- Tools: uupd | rechunk | cosign
- Project Repository: MiOS-DEV/MiOS-bootstrap
- Sole Proprietor: MiOS-DEV