🐛 Fix musl-cross install in rust-tools stage 🐛

musl-cross is in the Alpine community repo, which rust:alpine does not
enable by default. `apk add --no-cache musl-cross` failed with
"no such package" on both linux/amd64 and linux/amd64->arm64 stages.
Fix: install curl and jq first (both in main), then fetch musl-cross
from the community repo via --repository flag (no permanent repo change).
- Dockerfile: split rust-tools apk install into main + community steps

Dockerfile
This commit is contained in:
2026-06-21 18:13:05 -04:00
parent fe1598c890
commit a10a527f46
+4 -2
View File
@@ -40,8 +40,10 @@ FROM tianon/gosu:latest AS gosu
FROM --platform=$BUILDPLATFORM rust:alpine AS rust-tools
ARG TARGETARCH
# musl-cross provides aarch64-linux-musl-gcc for arm64 cross-compilation
RUN apk add --no-cache musl-cross curl jq
# musl-cross provides aarch64-linux-musl-gcc for arm64 cross-compilation;
# it lives in the Alpine community repo which rust:alpine does not enable by default
RUN apk add --no-cache curl jq \
&& apk add --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/edge/community musl-cross
# Resolve Docker TARGETARCH → Rust target triple
RUN case "${TARGETARCH}" in \