Prerequisites
Before building, ensure you have:- Met all system requirements
- Cloned the IC repository
- A clean Git working directory (no uncommitted changes)
Quick Start
The simplest way to build the IC is using the containerized build script:artifacts/ directory at the repository root.
Build Script Options
Thebuild-ic.sh script provides several options for building different components:
Command-Line Flags
Build IC binaries
Build IC canisters
Build IC-OS images (GuestOS, HostOS, SetupOS, Recovery)
Non-release build (for non-protected branches not in rc—* or master)
Display help information
Usage Examples
Build Targets
The build script uses Bazel targets to build different components:Binaries
artifacts/release/
Canisters
artifacts/canisters/
IC-OS Images
artifacts/icos/
Bazel Build Process
Build Configuration
The build script uses common Bazel arguments:- Release Build
- Development Build
Release builds (on This includes version information in the built artifacts.
master or rc--* branches) use the --config=stamped flag:Build Artifacts
After building, artifacts are organized by type:SHA256SUMS file with checksums for verification.
Building Specific Components
Building Individual IC-OS Images
You can build specific IC-OS images directly with Bazel:GuestOS
GuestOS
bazel-bin/ic-os/guestos/envs/<env>/HostOS
HostOS
bazel-bin/ic-os/hostos/envs/<env>/SetupOS
SetupOS
bazel-bin/ic-os/setupos/envs/<env>/Development images (
dev targets) allow console access with username/password: root/rootProduction images (prod targets) have console access disabled for security.Containerized Build
The containerized build automatically handles the environment setup:- Checks if running inside the
ic-buildcontainer - If not, drops into the container using
container-run.sh - Runs the build inside the container
- Copies artifacts to the host’s
artifacts/directory
The container is defined in
ci/container/Dockerfile and includes all necessary dependencies.Manual Build (Without Container)
If you have all dependencies installed locally:Troubleshooting
Error: Git working directory is not clean
Error: Git working directory is not clean
The build requires a clean Git state.
Error: Build script nested, aborting
Error: Build script nested, aborting
This indicates the container detection failed. Try cleaning up and rebuilding:
Out of disk space
Out of disk space
Bazel builds can consume significant disk space. Ensure you have at least 100 GB free.
Podman not found
Podman not found
Install Podman for containerized builds:
Bazel version mismatch
Bazel version mismatch
Ensure you’re using the correct Bazel version:
Build Performance Tips
Use Local Cache
Bazel caches build outputs. Subsequent builds are much faster.
Parallel Builds
Bazel automatically parallelizes builds based on available CPU cores.
Build Specific Targets
Only build what you need to save time and disk space.
More RAM
More RAM improves build performance, especially for linking.
Verifying Build Outputs
After building, verify the checksums:Next Steps
Verifying Releases
Learn how to verify build reproducibility
IC-OS Overview
Deep dive into IC-OS architecture