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 \