🐛 Switch probe-rs/sqlx-cli/sea-orm-cli to binstall prebuilt-only 🐛
Build and Push / build (push) Failing after 26m26s

All three tools were using bare `cargo install` with no binstall
attempt, forcing full source compilation on every amd64-musl build.
probe-rs took ~73 minutes, sqlx-cli and sea-orm-cli each ~82 minutes —
totalling ~4 hours of source compilation that crashed the BuildKit
container before the amd64 image could be assembled.
All three publish x86_64-unknown-linux-musl prebuilts on GitHub
releases. Switching to `cargo binstall -y --target ... 2>/dev/null ||
true` means:
- amd64: prebuilt downloaded in seconds; source never attempted
- arm64: no aarch64-musl prebuilt; binstall tries source, fails fast
(ring/openssl missing musl cross-compile headers), || true skips it
- Dockerfile: replace three `cargo install` lines with `cargo binstall`

Dockerfile
This commit is contained in:
2026-06-23 20:13:03 -04:00
parent 94a68fa08e
commit 9715d9f39e
+3 -5
View File
@@ -156,11 +156,9 @@ RUN --mount=type=cache,id=cargo-registry-native,sharing=shared,target=/usr/local
cargo binstall -y --target "${RUST_TARGET}" samply 2>/dev/null || true; \ cargo binstall -y --target "${RUST_TARGET}" samply 2>/dev/null || true; \
cargo binstall -y --target "${RUST_TARGET}" flamegraph 2>/dev/null || \ cargo binstall -y --target "${RUST_TARGET}" flamegraph 2>/dev/null || \
cargo install --target "${RUST_TARGET}" flamegraph || true; \ cargo install --target "${RUST_TARGET}" flamegraph || true; \
cargo install --target "${RUST_TARGET}" probe-rs --features cli 2>/dev/null || true; \ cargo binstall -y --target "${RUST_TARGET}" probe-rs 2>/dev/null || true; \
cargo install --target "${RUST_TARGET}" sqlx-cli \ cargo binstall -y --target "${RUST_TARGET}" sqlx-cli 2>/dev/null || true; \
--no-default-features --features rustls,postgres,mysql,sqlite 2>/dev/null || true; \ cargo binstall -y --target "${RUST_TARGET}" sea-orm-cli 2>/dev/null || true
cargo install --target "${RUST_TARGET}" sea-orm-cli \
--no-default-features --features codegen,sqlx-mysql,sqlx-postgres,sqlx-sqlite,runtime-tokio-rustls 2>/dev/null || true
FROM ${PULL_URL}:${DISTRO_VERSION} AS build FROM ${PULL_URL}:${DISTRO_VERSION} AS build
ARG TZ ARG TZ