Build the amd64 image with QEMU 9.2.2 and only emulate the final stage
QEMU 8.x crashes running x86_64 programs on an arm64 host (QEMU issue 2168), which the 8.1.5 pin walked into, and 10.2 segfaults on the runner as well; 9.2.2 runs node, composer and install-php-extensions on the runner's host. The Composer and npm stages now build on the build machine's platform: their output is the same for every target, so a multi-arch build runs them once and natively. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V9NnLxnPp8vaaurb3Z1MFy
This commit is contained in:
co-authored by
Claude Opus 5
parent
21bea9646d
commit
09e24ade14
+6
-3
@@ -1,7 +1,9 @@
|
||||
# ============================================
|
||||
# Stage 1: Install PHP dependencies
|
||||
# ============================================
|
||||
FROM composer:2 AS vendor
|
||||
# Built on the build machine's own platform: vendor/ is plain PHP, the same for every target, so a
|
||||
# multi-arch build runs it once and never under emulation.
|
||||
FROM --platform=$BUILDPLATFORM composer:2 AS vendor
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -21,8 +23,9 @@ RUN composer dump-autoload --optimize --no-dev
|
||||
# ============================================
|
||||
# Stage 2: Build frontend assets
|
||||
# ============================================
|
||||
# After Composer: the stylesheet and script import Livewire Material from vendor/.
|
||||
FROM node:24-alpine AS assets
|
||||
# After Composer: the stylesheet and script import Livewire Material from vendor/. On the build
|
||||
# machine's platform too: the output is CSS and JavaScript, whatever the target.
|
||||
FROM --platform=$BUILDPLATFORM node:24-alpine AS assets
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
||||
Reference in New Issue
Block a user