Skip to content

Commit ff42e36

Browse files
nflaigphilknows
authored andcommitted
fix: remove docker build stage to rebuild native dependencies (#8819)
1 parent f3f59a0 commit ff42e36

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

Dockerfile

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
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
42
ARG COMMIT
53
WORKDIR /usr/app
64
RUN 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.
2119
RUN 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)
3723
FROM node:24-slim
3824
WORKDIR /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

0 commit comments

Comments
 (0)