Skip to main content

Overview

The Podman build method is the recommended approach for building Redox OS. It provides a consistent, reproducible build environment by using containerization, eliminating issues caused by different host configurations.
Why Podman? Podman provides rootless containers with better security than traditional Docker, and it’s the default containerization solution for Redox OS builds.

Prerequisites

System Requirements

  • Operating System: Linux, macOS, FreeBSD, or Windows WSL2
  • Memory: At least 8GB RAM (16GB recommended)
  • Disk Space: 20-30GB free space
  • Podman: Version 3.0 or higher

Required Software

Bootstrap Installation

Redox provides an automated bootstrap script that installs all dependencies and sets up the build environment.

Using the Bootstrap Script

1

Download the Bootstrap Script

2

Make it Executable

3

Run the Bootstrap

For QEMU (recommended):
For VirtualBox:

What the Bootstrap Does

The podman_bootstrap.sh script performs these actions:
  • Detects your operating system
  • Installs Podman and required packages
  • Installs the selected emulator (QEMU or VirtualBox)
  • Sets up FUSE and overlay filesystem support
  • Checks for existing Rust installations
  • Offers to install rustup if not present
  • Configures the stable Rust toolchain
  • Updates PATH for cargo binaries
  • Clones the Redox OS repository from GitLab
  • Creates .config with PODMAN_BUILD=1
  • Sets up the directory structure

Manual Setup

If you prefer to set up manually or the bootstrap script doesn’t work for your system:

1. Clone the Repository

2. Create Configuration File

Create a .config file in the repository root:
.config
Optional configuration for ARM64 Macs:
.config
Add REPO_BINARY=1 to use pre-built packages for much faster builds (recommended for first-time users)

3. Install Rust

If you don’t have Rust installed:

Building Redox OS

Container Setup

The first time you run make, the build system will automatically create the Podman container:
This process:
  1. Builds a Podman image based on podman/redox-base-containerfile
  2. Installs build dependencies inside the container
  3. Sets up the Rust toolchain in the container
  4. Creates a tag file at build/container.tag
The initial container build can take 10-30 minutes depending on your internet connection and CPU speed.

Build Process Flow

When using Podman builds, make targets automatically delegate to the container:

Configuration Variables

The Podman build system uses several environment variables defined in mk/podman.mk:
IMAGE_TAG
string
default:"redox-base"
Docker image tag for the Podman container
CONTAINER_WORKDIR
string
default:"/mnt/redox"
Working directory inside the container
USE_SELINUX
integer
default:"1"
Enable SELinux volume flags (:Z) for systems with SELinux
PODMAN_CACHE_PULL
integer
default:"1"
Pull cached layers from Docker Hub to speed up builds

Build Examples

Container Management

Container Shell Access

To get a shell inside the build container:
This is useful for:
  • Debugging build issues
  • Inspecting build artifacts
  • Running custom commands in the build environment

Rebuilding the Container

If you need to rebuild the container (e.g., after updating the Containerfile):
container_clean will remove the container and all cached layers. The next build will take longer.

Container Cleanup

Podman Configuration Details

Volume Mounts

The container mounts these volumes:

Environment Variables

These variables are passed to the container:

Container Capabilities

The container runs with these capabilities:

Filesystem Tools in Podman

By default, filesystem tools (redoxfs, redox_installer) run on the host. To run them inside Podman:
.config
Running filesystem tools in Podman requires proper FUSE support in your container environment.

Troubleshooting

Symptoms: Error during podman build commandSolutions:
  • Check your internet connection
  • Verify Podman is properly installed: podman --version
  • Try cleaning and rebuilding: make container_clean && make all
  • Check system logs: journalctl -xe | grep podman
Symptoms: Cannot mount filesystem, permission deniedSolutions:
  • Ensure FUSE is installed on host
  • Check FUSE device permissions: ls -l /dev/fuse
  • Verify user is in fuse group: groups
  • Try rootless Podman: podman unshare cat /proc/self/uid_map
Symptoms: Volume mount errors on Fedora/RHELSolutions:
  • Disable SELinux volume flags in .config:
  • Or configure SELinux to allow container access
Symptoms: Builds take hours to completeSolutions:
  • Enable binary packages:
  • Enable pre-built toolchain:
  • Use a minimal configuration:

Advanced Topics

Custom Containerfile

You can specify a custom Containerfile:
.config

Cache Management

Podman builds support layer caching via Docker Hub:
.config

Multi-Architecture Builds

Build for different architectures from the same host:

Next Steps

Configuration Options

Customize your build settings

Recipe System

Learn about building packages