Skip to content

Building for Ubuntu 22

Brett Terpstra edited this page Aug 15, 2026 · 1 revision

Building for Ubuntu 22

Use this when you need an Apex binary that runs on Ubuntu 22.04 (Jammy). Building on a newer host (macOS, Ubuntu 24.04, etc.) can produce a binary that fails on 22.04 because of a newer glibc.

Run the command from the Apex repository root. Docker must be installed and running.

x86_64 (amd64)

This is the usual target for Linux servers:

docker run --rm \
  --platform linux/amd64 \
  -v "$(pwd):/workspace" \
  -w /workspace \
  ubuntu:22.04 \
  bash -c 'apt-get update && apt-get install -y build-essential cmake git libyaml-dev pkg-config && git submodule update --init --recursive && cmake -S . -B build-ubuntu-22 -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -Wno-dev && cmake --build build-ubuntu-22 --target apex_cli -j$(nproc)'

The CLI binary is written to build-ubuntu-22/apex.

ARM64

On Apple Silicon, omit --platform linux/amd64 to build a native ARM64 Ubuntu 22 binary instead:

docker run --rm \
  -v "$(pwd):/workspace" \
  -w /workspace \
  ubuntu:22.04 \
  bash -c 'apt-get update && apt-get install -y build-essential cmake git libyaml-dev pkg-config && git submodule update --init --recursive && cmake -S . -B build-ubuntu-22 -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -Wno-dev && cmake --build build-ubuntu-22 --target apex_cli -j$(nproc)'

Verify

./build-ubuntu-22/apex --version
file build-ubuntu-22/apex

On the Ubuntu 22 host, file should report an ELF binary for the architecture you built (x86-64 or ARM aarch64).

See Installation for native source builds and other platforms.

Quick Links

Clone this wiki locally