From 84cc42a0d413d08a6c3040560d98877dc828bf30 Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Thu, 7 May 2026 15:15:10 +0800 Subject: [PATCH] fix: manually extract arm64 unixodbc debs instead of multiarch apt Debian multiarch apt sources cause dependency conflicts with gcc-x86-64-linux-gnu. Instead, download arm64 .deb packages directly from deb.debian.org and extract with dpkg -x to get the arm64 libodbc headers and libraries without apt dependency resolution. --- Dockerfile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index ef2651603..11d62d0f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,17 +16,21 @@ RUN pnpm build FROM --platform=$BUILDPLATFORM rust:1-bookworm AS backend ARG TARGETARCH WORKDIR /app -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 \ +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential cmake pkg-config perl python3-pip gcc-aarch64-linux-gnu \ + unixodbc-dev \ && pip3 install --break-system-packages ziglang \ && cargo install cargo-zigbuild \ && rustup target add x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /tmp/arm64-odbc && cd /tmp/arm64-odbc \ + && curl -sLO http://deb.debian.org/debian/pool/main/u/unixodbc/libodbc2_2.3.11-2+deb12u1_arm64.deb \ + && curl -sLO http://deb.debian.org/debian/pool/main/u/unixodbc/libodbcinst2_2.3.11-2+deb12u1_arm64.deb \ + && curl -sLO http://deb.debian.org/debian/pool/main/u/unixodbc/unixodbc-dev_2.3.11-2+deb12u1_arm64.deb \ + && dpkg -x libodbc2_*.deb / \ + && dpkg -x libodbcinst2_*.deb / \ + && dpkg -x unixodbc-dev_*.deb / \ + && rm -rf /tmp/arm64-odbc # Copy dependency manifests only and create dummy sources to pre-compile dependencies. # This layer is cached by GHA as long as Cargo.toml/Cargo.lock don't change.