diff options
| author | Anders Betts <anders.betts@gmail.com> | 2026-09-20 23:09:31 +0200 |
|---|---|---|
| committer | Anders Betts <anders.betts@gmail.com> | 2026-09-20 23:09:31 +0200 |
| commit | 19e4d8dcc9c9e76a8c90855cccb4c4553b35389e (patch) | |
| tree | d014fd0baebc2e269ee6e2f3def2c657aaee3659 /deploy | |
| parent | fe40173f32b14e012044b39f0f63c2613787e725 (diff) | |
| download | bokf-0.1.54.tar.gz bokf-0.1.54.zip | |
deploy: cross-compile static aarch64 for the Alpine imagev0.1.54
Diffstat (limited to 'deploy')
| -rw-r--r-- | deploy/Dockerfile.cross | 13 | ||||
| -rw-r--r-- | deploy/cross-build.sh | 16 |
2 files changed, 29 insertions, 0 deletions
diff --git a/deploy/Dockerfile.cross b/deploy/Dockerfile.cross new file mode 100644 index 0000000..ab0504c --- /dev/null +++ b/deploy/Dockerfile.cross @@ -0,0 +1,13 @@ +# Cross-compile the static arm64 backend binaries on an amd64 host. The +# runtime image is assembled later on the target host from the produced +# binaries; there is no TUI in the runtime image. +FROM debian:bookworm +RUN dpkg --add-architecture arm64 \ + && apt-get update \ + && apt-get install -y --no-install-recommends \ + make ca-certificates gcc-aarch64-linux-gnu \ + libc6-dev:arm64 libssl-dev:arm64 \ + && rm -rf /var/lib/apt/lists/* +COPY cross-build.sh /usr/local/bin/cross-build +RUN chmod 0755 /usr/local/bin/cross-build +ENTRYPOINT ["/usr/local/bin/cross-build"] diff --git a/deploy/cross-build.sh b/deploy/cross-build.sh new file mode 100644 index 0000000..19d07b7 --- /dev/null +++ b/deploy/cross-build.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# Cross-compile the static aarch64 backend binaries (bokfd, bokfctl). +# Expects the source read-only at /src, writes the binaries to /out and takes +# the version from $VERSION. Run through deploy/Dockerfile.cross. OpenSSL and +# glibc are linked statically, so the Alpine runtime image needs no shared +# libraries (the kernel ABI is all that matters). +set -eu + +make -C /src -j"$(nproc)" BUILD=/tmp/build backend \ + CC=aarch64-linux-gnu-gcc \ + CFLAGS="-O2 -g -static -L/usr/lib/aarch64-linux-gnu" \ + SSL_LIBS="-l:libssl.a -l:libcrypto.a -ldl -lpthread" \ + VERSION="${VERSION:-0.1.0-dev}" + +mkdir -p /out +cp /tmp/build/bokfd /tmp/build/bokfctl /out/ |
