From 19e4d8dcc9c9e76a8c90855cccb4c4553b35389e Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Sun, 20 Sep 2026 23:09:31 +0200 Subject: deploy: cross-compile static aarch64 for the Alpine image --- Dockerfile | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 65ce8df..63d120f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,14 +7,23 @@ RUN apk add --no-cache build-base openssl-dev WORKDIR /src COPY . . ARG VERSION=0.1.0-dev -RUN make -j"$(nproc)" backend VERSION="$VERSION" \ - && make test-core VERSION="$VERSION" \ +# With .prebuilt/ the static aarch64 binaries are cross-compiled on the +# development machine (deploy/Dockerfile.cross); otherwise build and test from +# source on this host. +RUN if [ -x .prebuilt/bokfd ]; then \ + mkdir -p build && \ + cp .prebuilt/bokfd .prebuilt/bokfctl build/; \ + else \ + make -j"$(nproc)" backend VERSION="$VERSION" \ + && make test-core VERSION="$VERSION"; \ + fi \ && strip build/bokfd build/bokfctl -# The runtime image carries the daemon and bokfctl only. The ncurses TUI is a -# frontend: build it from source on the machine you sit at. +# The runtime image carries the daemon and bokfctl only, statically linked +# against OpenSSL and the C library; the ncurses TUI is a frontend built on the +# machine you sit at. FROM alpine:3.24 AS runtime -RUN apk add --no-cache libssl3 ca-certificates util-linux \ +RUN apk add --no-cache ca-certificates util-linux \ && addgroup -S bokfd \ && adduser -S -D -H -u 10001 -G bokfd -s /sbin/nologin bokfd \ && install -d -o bokfd -g bokfd /var/lib/bokfd /var/lib/bokfd/backup \ -- cgit v1.3