fix: explicitly set TARGETARCH for Docker multi-arch builds

This commit is contained in:
Nathan Flurry 2026-01-28 02:06:59 -08:00
parent d7f32f3ee5
commit 6b15432c71
2 changed files with 5 additions and 4 deletions

View file

@ -1,11 +1,9 @@
# syntax=docker/dockerfile:1.10.0
ARG TARGETARCH
# ============================================================================
# AMD64 Builder - Uses cross-tools musl toolchain
# ============================================================================
FROM rust:1.88.0 AS builder-amd64
FROM --platform=linux/amd64 rust:1.88.0 AS builder-amd64
ENV DEBIAN_FRONTEND=noninteractive
@ -70,7 +68,7 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \
# ============================================================================
# ARM64 Builder - Uses Alpine with native musl
# ============================================================================
FROM rust:1.88-alpine AS builder-arm64
FROM --platform=linux/arm64 rust:1.88-alpine AS builder-arm64
RUN apk add --no-cache \
musl-dev \
@ -101,6 +99,7 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \
# ============================================================================
# Select the appropriate builder based on target architecture
# ============================================================================
ARG TARGETARCH
FROM builder-${TARGETARCH} AS builder
# Runtime stage - minimal image