Skip to content

Commit 70c5077

Browse files
authored
client: Add dockerfile for build from source (#2329)
* client: Add dockerfile for build from source
1 parent 32dcd8f commit 70c5077

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

.github/workflows/client-build.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,18 @@ jobs:
6565
# https://github.com/docker/setup-buildx-action
6666
- name: Set up Docker Buildx
6767
uses: docker/setup-buildx-action@v1
68-
- name: Build
68+
- name: Build from npm
6969
run: >
7070
docker buildx build .
71-
--tag ethereumjs:local
71+
--tag ethereumjs:local-npm
72+
--platform linux/amd64
73+
--build-arg COMMIT=$(git rev-parse HEAD)
74+
working-directory: ${{github.workspace}}
75+
- name: Build from source
76+
run: >
77+
docker buildx build .
78+
-f Dockerfile.fromSouce
79+
--tag ethereumjs:local-source
7280
--platform linux/amd64
7381
--build-arg COMMIT=$(git rev-parse HEAD)
7482
working-directory: ${{github.workspace}}

Dockerfile.fromSouce

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM node:16-alpine as build
2+
WORKDIR /usr/app
3+
RUN apk update && apk add --no-cache bash git g++ make python3 && rm -rf /var/cache/apk/*
4+
5+
COPY . /usr/app
6+
WORKDIR /usr/app
7+
RUN npm i
8+
9+
FROM node:16-alpine
10+
WORKDIR /usr/app
11+
COPY --from=build /usr/app .
12+
13+
# Sanity check
14+
#RUN node /usr/app/packages/client/dist/bin/cli.js --help
15+
RUN node /usr/app/node_modules/.bin/ethereumjs --help
16+
17+
18+
# NodeJS applications have a default memory limit of 2.5GB.
19+
# This limit is bit tight, it is recommended to raise the limit
20+
# since memory may spike during certain network conditions.
21+
ENV NODE_OPTIONS=--max_old_space_size=6144
22+
23+
ENTRYPOINT ["node", "/usr/app/node_modules/.bin/ethereumjs"]

0 commit comments

Comments
 (0)