File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,16 +28,19 @@ RUN set -ex && \
2828 rm -rf /var/lib/apt/lists/*
2929
3030# Install Node.js
31+ ARG TARGETARCH
3132RUN set -ex && \
3233 # Detect architecture
33- ARCH=$ (dpkg --print-architecture 2>/dev/null || echo "x64" ) && \
34+ ARCH="${TARGETARCH:-$ (dpkg --print-architecture 2>/dev/null || echo " x64")}" && \
3435 if [ "$ARCH" = "amd64" ]; then ARCH="x64" ; fi && \
3536 if [ "$ARCH" = "arm64" ]; then ARCH="arm64" ; fi && \
37+ echo "Detected architecture: $ARCH" && \
3638 # Download Node.js binary and checksum
3739 curl -fsSLO "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${ARCH}.tar.xz" && \
3840 curl -fsSLO "https://nodejs.org/dist/v${NODE_VERSION}/SHASUMS256.txt" && \
3941 # Verify checksum
40- grep " node-v${NODE_VERSION}-linux-${ARCH}.tar.xz\$ " SHASUMS256.txt | sha256sum -c - && \
42+ grep " node-v${NODE_VERSION}-linux-${ARCH}.tar.xz\$ " SHASUMS256.txt > SHASUMS256.txt.verify && \
43+ sha256sum -c SHASUMS256.txt.verify && \
4144 # Extract and install
4245 mkdir -p /usr/local/node && \
4346 tar -xJf "node-v${NODE_VERSION}-linux-${ARCH}.tar.xz" --strip-components=1 -C /usr/local/node && \
You can’t perform that action at this time.
0 commit comments