From a6ea8deb53957ecc35bdd279d36ecdb5007b5f98 Mon Sep 17 00:00:00 2001 From: Michael Oliver Date: Sun, 22 Jun 2025 16:37:14 -0700 Subject: [PATCH] Force amd64 platform and limit final ffmpeg build to prevent crashes Attempting to build on mac m4 w/ 24gb of ram fails due to wrong arch (arm vs amd64) and out of control memory consumption that crashes docker on the last ffmpeg build process unless we limit cpu's to 2 which seems to keep docker around 8GB. This fixes both things. --- Dockerfile | 2 +- Makefile | 1 + build/ffmpeg.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 51275c46464..df3c8fa1427 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile-upstream:master-labs # Base emsdk image with environment variables. -FROM emscripten/emsdk:3.1.40 AS emsdk-base +FROM --platform=linux/amd64 emscripten/emsdk:3.1.40 AS emsdk-base ARG EXTRA_CFLAGS ARG EXTRA_LDFLAGS ARG FFMPEG_ST diff --git a/Makefile b/Makefile index 8e260bc5bbe..3af69a43e7b 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,7 @@ build: FFMPEG_ST="$(FFMPEG_ST)" \ FFMPEG_MT="$(FFMPEG_MT)" \ docker buildx build \ + --platform linux/amd64 \ --build-arg EXTRA_CFLAGS \ --build-arg EXTRA_LDFLAGS \ --build-arg FFMPEG_MT \ diff --git a/build/ffmpeg.sh b/build/ffmpeg.sh index da89c451aea..e2ee0879550 100755 --- a/build/ffmpeg.sh +++ b/build/ffmpeg.sh @@ -30,4 +30,4 @@ CONF_FLAGS=( ) emconfigure ./configure "${CONF_FLAGS[@]}" $@ -emmake make -j +emmake make -j2