File tree Expand file tree Collapse file tree 1 file changed +2
-16
lines changed
Expand file tree Collapse file tree 1 file changed +2
-16
lines changed Original file line number Diff line number Diff line change 1- # --platform=$BUILDPLATFORM is used build javascript source with host arch
2- # Otherwise TS builds on emulated archs and can be extremely slow (+1h)
3- FROM --platform=${BUILDPLATFORM:-amd64} node:24-slim AS build_src
1+ FROM node:24-slim AS build_src
42ARG COMMIT
53WORKDIR /usr/app
64RUN apt-get update && apt-get install -y git g++ make python3 python3-setuptools && apt-get clean && rm -rf /var/lib/apt/lists/*
@@ -20,23 +18,11 @@ RUN corepack enable && corepack prepare --activate && \
2018# the terminal and in the logs; which is very useful to track tests better.
2119RUN cd packages/cli && GIT_COMMIT=${COMMIT} pnpm write-git-data
2220
23-
24- # Copy built src + node_modules to build native packages for archs different than host.
25- # Note: This step is redundant for the host arch
26- FROM node:24-slim AS build_deps
27- WORKDIR /usr/app
28- RUN apt-get update && apt-get install -y git g++ make python3 python3-setuptools && apt-get clean && rm -rf /var/lib/apt/lists/*
29-
30- COPY --from=build_src /usr/app .
31-
32- # Rebuild native deps
33- RUN corepack enable && pnpm install --frozen-lockfile --prod && pnpm rebuild
34-
3521# Copy built src + node_modules to a new layer to prune unnecessary fs
3622# Previous layer weights 7.25GB, while this final 488MB (as of Oct 2020)
3723FROM node:24-slim
3824WORKDIR /usr/app
39- COPY --from=build_deps /usr/app .
25+ COPY --from=build_src /usr/app .
4026
4127# NodeJS applications have a default memory limit of 4GB on most machines.
4228# This limit is bit tight for a Mainnet node, it is recommended to raise the limit
You can’t perform that action at this time.
0 commit comments