🐛 Force IPv4 in rust-tools stage to fix GitHub SSL errors 🐛

IPv6 routing on this host intercepts *.github.com and presents a
certificate for a local domain, causing curl SSL SAN mismatch errors
when downloading sccache and cargo-binstall from GitHub releases.
Same fix as the Go image's 05-custom.sh: write `-4` to /root/.curlrc
at the top of the rust-tools stage so all subsequent curl calls use IPv4.
- Dockerfile: add `printf -- '-4
' > /root/.curlrc` at start of rust-tools stage

Dockerfile
This commit is contained in:
2026-06-21 18:18:30 -04:00
parent 0a06ccafa1
commit 1d03c20129
+4
View File
@@ -40,6 +40,10 @@ FROM tianon/gosu:latest AS gosu
FROM --platform=$BUILDPLATFORM rust:alpine AS rust-tools
ARG TARGETARCH
# Force IPv4 for all curl calls — IPv6 routing on this host intercepts
# *.github.com and presents a cert for a local domain, causing SSL SAN mismatch
RUN printf -- '-4\n' > /root/.curlrc
# zig acts as a universal C/C++ cross-compiler — ships with bundled musl headers
# and stdlib for all targets, so no separate musl-cross toolchain is needed.
# Wrapper scripts named aarch64-linux-musl-{gcc,g++,ar} let the CARGO_TARGET_*