fix(docker): split RUN steps to fix Node.js install on multi-platform build (#108)

Separate apt-get install from Node.js download into two RUN layers.
The piped curl|tar command fails with 404 when ca-certificates from
apt layer is not yet available during parallel multi-platform build.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ekko
2026-04-21 15:36:47 +08:00
committed by GitHub
parent 832029a5b3
commit ed1f7d8301
+8 -3
View File
@@ -8,11 +8,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
make \
g++ \
&& ARCH=$(dpkg --print-architecture) \
&& curl -fsSL "https://nodejs.org/dist/v23.11.0/node-v23.11.0-linux-${ARCH}.tar.gz" \
| tar -xz -C /usr/local --strip-components=1 \
&& rm -rf /var/lib/apt/lists/*
RUN ARCH=$(dpkg --print-architecture) \
&& echo "Downloading Node.js v23.11.0 for ${ARCH}" \
&& curl -fsSL "https://nodejs.org/dist/v23.11.0/node-v23.11.0-linux-${ARCH}.tar.gz" \
-o /tmp/node.tar.gz \
&& tar -xzf /tmp/node.tar.gz -C /usr/local --strip-components=1 \
&& rm -f /tmp/node.tar.gz \
&& node --version
WORKDIR /app
COPY package*.json ./