From 3be5ee64454e2040424f1ffb81dca525f64b8f14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E6=AD=A3=E8=B6=85?= Date: Wed, 16 Jul 2025 23:53:28 +0800 Subject: [PATCH] fix: simplify Dockerfile.source and resolve build issues (#231) - Remove complex dependency caching to fix workspace structure issues - Remove sccache to eliminate rustc wrapper errors - Ensure target installation in build step for cross-compilation - Add debug output and error handling for unsupported platforms - Use simple COPY . . approach for more reliable builds --- Dockerfile.source | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile.source b/Dockerfile.source index 85db4a84..c4bb4dff 100644 --- a/Dockerfile.source +++ b/Dockerfile.source @@ -79,13 +79,20 @@ RUN cargo run --bin gproto # Build the actual application with optimizations RUN case "$TARGETPLATFORM" in \ "linux/amd64") \ + echo "🔨 Building for amd64..." && \ + rustup target add x86_64-unknown-linux-gnu && \ cargo build --release --target x86_64-unknown-linux-gnu --bin rustfs -j $(nproc) && \ cp target/x86_64-unknown-linux-gnu/release/rustfs /usr/local/bin/rustfs \ ;; \ "linux/arm64") \ + echo "🔨 Building for arm64..." && \ + rustup target add aarch64-unknown-linux-gnu && \ cargo build --release --target aarch64-unknown-linux-gnu --bin rustfs -j $(nproc) && \ cp target/aarch64-unknown-linux-gnu/release/rustfs /usr/local/bin/rustfs \ ;; \ + *) \ + echo "❌ Unsupported platform: $TARGETPLATFORM" && exit 1 \ + ;; \ esac # Runtime stage - Ubuntu minimal for better compatibility