forked from Mister-EA/bsc-docker-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
70 lines (41 loc) · 1.29 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Start from the Go base image
FROM golang:1.19-alpine
RUN apk add --no-cache make cmake gcc musl-dev linux-headers git bash build-base libc-dev
ADD ./bsc /bsc
ENV CGO_CFLAGS="-O -D__BLST_PORTABLE__"
ENV CGO_CFLAGS_ALLOW="-O -D__BLST_PORTABLE__"
# Now copy over the entire bsc.
# Please keep in mind, Docker will need to re-run the steps from here every time any file changes inside the ./bsc directory
COPY ./bsc /bsc
# Now move into the bsc folder
WORKDIR /bsc
# Run make geth
RUN make geth
# Build the app
RUN go build -o ./build/bin/bootnode ./cmd/bootnode
# Copy the binary to a stable location
RUN mkdir -p /app/bin \
&& cp ./build/bin/geth /app/bin/geth \
&& cp ./build/bin/bootnode /app/bin/bootnode
# Beacon Chain
COPY ./node /node
WORKDIR /node
RUN make build
RUN cp ./build/tbnbcli /app/bin/tbnbcli
RUN cp ./build/bnbchaind /app/bin/bnbchaind
WORKDIR /app
COPY ./bsc-genesis-contract/genesis.json .
COPY ./config.toml .
RUN mkdir bls
RUN mkdir keystore
RUN apk add --no-cache jq
EXPOSE 8545 6060 30311 30311/udp
# init genesis
RUN bin/geth init --datadir . genesis.json
RUN rm -f geth/nodekey
ENV AUTHORITY_NAME "alice"
RUN echo ${AUTHORITY_NAME}
# Run validator
COPY ./docker_entrypoint.sh .
RUN chmod +x /app/docker_entrypoint.sh
ENTRYPOINT ["/app/docker_entrypoint.sh"]