From 15b433c99ad3ee5ba592a3bc838f852963ea58e8 Mon Sep 17 00:00:00 2001 From: sd0xdev <107539203+sd0xdev@users.noreply.github.com> Date: Fri, 30 Jan 2026 12:42:11 +0800 Subject: [PATCH] fix: Dockerfile supports arm64 Node download Select the correct Node.js binary tarball based on dpkg architecture. - amd64 -> linux-x64 - arm64 -> linux-arm64 This fixes exec format errors when building the sandbox container on arm64 hosts. --- Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3fb55a3..d7fd5d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,14 @@ FROM docker.io/cloudflare/sandbox:0.7.0 # The base image has Node 20, we need to replace it with Node 22 # Using direct binary download for reliability ENV NODE_VERSION=22.13.1 -RUN apt-get update && apt-get install -y xz-utils ca-certificates rsync \ - && curl -fsSLk https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz -o /tmp/node.tar.xz \ +RUN ARCH="$(dpkg --print-architecture)" \ + && case "${ARCH}" in \ + amd64) NODE_ARCH="x64" ;; \ + arm64) NODE_ARCH="arm64" ;; \ + *) echo "Unsupported architecture: ${ARCH}" >&2; exit 1 ;; \ + esac \ + && apt-get update && apt-get install -y xz-utils ca-certificates rsync \ + && curl -fsSLk https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz -o /tmp/node.tar.xz \ && tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 \ && rm /tmp/node.tar.xz \ && node --version \