From ddd1733e8fdde49d47e32a3ee5caaa6f45418410 Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Thu, 7 May 2026 15:07:36 +0800 Subject: [PATCH] fix: configure Debian multiarch apt sources for arm64 cross-compilation The rust:1-bookworm image only has amd64 apt sources. Add explicit arm64 sources from deb.debian.org so unixodbc-dev:arm64 can be installed alongside the native amd64 version. --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 30e713785..ef2651603 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,10 +16,13 @@ RUN pnpm build FROM --platform=$BUILDPLATFORM rust:1-bookworm AS backend ARG TARGETARCH WORKDIR /app -RUN dpkg --add-architecture arm64 && dpkg --add-architecture amd64 \ +RUN dpkg --add-architecture arm64 \ + && echo "deb [arch=arm64] http://deb.debian.org/debian bookworm main" > /etc/apt/sources.list.d/arm64.list \ + && echo "deb [arch=arm64] http://deb.debian.org/debian bookworm-updates main" >> /etc/apt/sources.list.d/arm64.list \ + && echo "deb [arch=arm64] http://deb.debian.org/debian-security bookworm-security main" >> /etc/apt/sources.list.d/arm64.list \ && apt-get update && apt-get install -y --no-install-recommends \ build-essential cmake pkg-config perl python3-pip gcc-aarch64-linux-gnu gcc-x86-64-linux-gnu \ - unixodbc-dev unixodbc-dev:arm64 unixodbc-dev:amd64 \ + unixodbc-dev unixodbc-dev:arm64 \ && pip3 install --break-system-packages ziglang \ && cargo install cargo-zigbuild \ && rustup target add x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu \