Skip to content

Commit 8c3f6d9

Browse files
committed
Fix Linux container build for cross-platform compatibility
- Add --platform linux/amd64 to ensure x86_64 builds on ARM Macs - Fix read-only filesystem issue by copying source to /tmp in container - Successfully builds .deb and .tar.gz packages for x86_64 Linux
1 parent 2058e99 commit 8c3f6d9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

scripts/build-linux-docker.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ mkdir -p "$DIST_DIR"
136136
echo_step "Building Container Image"
137137
cd "$PROJECT_ROOT"
138138

139-
echo_info "Building Ubuntu 24.04 based container..."
139+
echo_info "Building Ubuntu 24.04 based container for x86_64..."
140140
$CONTAINER_RUNTIME build \
141+
--platform linux/amd64 \
141142
-f docker/Dockerfile.ubuntu-24.04 \
142143
-t fujisan-linux-builder:ubuntu24 \
143144
. || {
@@ -158,8 +159,11 @@ BUILD_TARBALL="$4"
158159
159160
echo "Building Fujisan version $VERSION..."
160161
162+
# Copy source to writable location
163+
cp -r /build/fujisan /tmp/fujisan-build
164+
cd /tmp/fujisan-build
165+
161166
# Configure CMake
162-
cd /build/fujisan
163167
mkdir -p build-release
164168
cd build-release
165169
@@ -342,8 +346,9 @@ chmod +x "$LINUX_BUILD_DIR/build-in-container.sh"
342346
# Run build in container
343347
echo_step "Building Fujisan in Container"
344348

345-
echo_info "Running build for version $VERSION..."
349+
echo_info "Running build for version $VERSION on x86_64..."
346350
$CONTAINER_RUNTIME run --rm \
351+
--platform linux/amd64 \
347352
-v "$PROJECT_ROOT:/build/fujisan:ro" \
348353
-v "$LINUX_BUILD_DIR:/output" \
349354
-e VERSION="$VERSION" \

0 commit comments

Comments
 (0)