Development (Docker Buildx)¶
This repo includes a Docker-based build pipeline that produces release artifacts for multiple architectures using Docker Buildx.
The main scripts are:
docker-build/init.sh: sets up a Buildx builder and builds the per-arch build imagesdocker-build/run-build.sh: runs the build inside those images and writes artifacts toout/- Needs work
docker-build/run-fpm.sh: runs the build and produces.deb/.rpmpackages (written toout/)
Requirements¶
- Docker
- Docker Buildx (
docker buildx versionshould work)
For cross-arch builds (e.g. building linux/arm64 on an x86_64 machine), you also need binfmt/qemu emulation enabled. The init script will attempt to install this via privileged containers.
1) Initialize Buildx + build the build images¶
Run from the repo root:
./docker-build/init.sh --init
This will:
- install binfmt/qemu handlers (for cross-arch builds)
- create or recreate a Buildx builder named
xrdriverbuilder - build and
--loadtwo images locally:xr-driver:amd64xr-driver:arm64
If you already have the builder and just want to reuse it, you can run:
./docker-build/init.sh
2) Build artifacts (tarball output)¶
After the images exist, run:
./docker-build/run-build.sh
To build only one architecture:
./docker-build/run-build.sh x86_64
./docker-build/run-build.sh aarch64
Build outputs are written under out/.
Notes:
- The build runs in containers, so intermediate files under
build/may be owned by root; the script cleansbuild/afterwards. - The build passes through
UA_API_SECRET(andUA_API_SECRET_INTENTIONALLY_EMPTY) as environment variables when running containers.
3) Build distro packages (.deb / .rpm)¶
If you want Debian/RPM packages, run:
./docker-build/run-fpm.sh
Or per-arch:
./docker-build/run-fpm.sh x86_64
./docker-build/run-fpm.sh aarch64
The resulting packages are moved to out/.
Troubleshooting¶
-
If
linux/arm64builds fail on x86_64, rerun init:./docker-build/init.sh --init -
Confirm Buildx sees the builder:
docker buildx ls docker buildx inspect xrdriverbuilder